ID:1908516
 
(See the best response by Super Saiyan X.)
Code:
runtime error: Safety violation: tried to access '/v/vegetassjj2' outside of current directory.
proc name: Click (/obj/cNew/Click)
source file: Save Mechanics.dm,1257
usr: Vegeta ssjj2 (Character Menu) (/mob/charactermenu)
src: the cNew (/obj/cNew)
call stack:
the cNew (/obj/cNew): Click(Creation6 (54,92,2) (/turf/Creation6), "map_pane.map", "icon-x=14;icon-y=25;left=1;scr...")


Problem description:

I cant create character because of this problem how can i fix it?

We need to see that part of your code.
If the first thing in your savefile path is a slash, you need to remove that.
obj
cNew
Click()
if(fexists("[save_path]/[copytext(usr.ckey,1,2)]/[usr.ckey]")) // Looks for written save file and if it exists it allows acces to load
alert(usr,"Delete your existing Character first")
return
if(istype(usr,/mob/charactermenu))
usr.NewCharacter()
cDelete
Click()
if(fexists("[save_path]/[copytext(usr.ckey,1,2)]/[usr.ckey]")) // Looks for written save file and if it exists it allows acces to load
if(alert(usr,"Are you sure you want to delete your character","Delete","Yes","No")=="Yes")
fdel("[save_path]/[copytext(usr.ckey,1,2)]/[usr.ckey]")
cLoad
Click()
if(!fexists("[save_path]/[copytext(usr.ckey,1,2)]/[usr.ckey]"))
alert(usr,"No Savefile is found")
return
if(istype(usr,/mob/charactermenu))
//usr.ChooseCharacter()
usr.Load()


This is the code
In response to Lummox JR
obj
cNew
Click()
if(fexists("[save_path]/[copytext(usr.ckey,1,2)]/[usr.ckey]")) // Looks for written save file and if it exists it allows acces to load
alert(usr,"Delete your existing Character first")
return
if(istype(usr,/mob/charactermenu))
usr.NewCharacter()
cDelete
Click()
if(fexists("[save_path]/[copytext(usr.ckey,1,2)]/[usr.ckey]")) // Looks for written save file and if it exists it allows acces to load
if(alert(usr,"Are you sure you want to delete your character","Delete","Yes","No")=="Yes")
fdel("[save_path]/[copytext(usr.ckey,1,2)]/[usr.ckey]")
cLoad
Click()
if(!fexists("[save_path]/[copytext(usr.ckey,1,2)]/[usr.ckey]"))
alert(usr,"No Savefile is found")
return
if(istype(usr,/mob/charactermenu))
//usr.ChooseCharacter()
usr.Load()
Best response
Are the host files in a folder with the same name as the dmb/rsc?
In response to Super Saiyan X
No the host files are in root/byond/bin

Should I make root/byond/bin/NR

NR is the name of .dmb and .rsc

I'm hosting using CentOS 6 Linux (Shell Server)
nvm guys it works now I just made trusted mode and it worked
Trusted mode shouldn't be necessary. If the DMB file is in a folder that doesn't share the same name as the DMB, you will get these access violations.
What is the value of save_path?
In response to Stephen001
how can I know?
how can I know?

It's a variable in your source code. Search for "save_path" in your source code and find where it's defined.
In response to Vegeta ssjj2
Vegeta ssjj2 wrote:
No the host files are in root/byond/bin

Should I make root/byond/bin/NR

NR is the name of .dmb and .rsc

I'm hosting using CentOS 6 Linux (Shell Server)

Yes. Your file paths should look like:

root/BYOND/bin/NR/NR.dmb
root/BYOND/bin/NR/NR.rsc
root/BYOND/bin/NR/therestofyourhost-relatedfiles
In response to Ter13
how can i fix coding issue cause i searched in save_path i didnt see any value
Given the path /v/vegatssjj2, this may well be your problem. Your code is assuming it will place savefiles under a directory in save_path, but that's null/empty, so it's placing it under /, which is obviously not alongside your DMB, hence the need for trusted mode.

Define save_path somewhere (or find where it's defined elsewhere in your code-base) and give it a value.
k i defined save_path=0 i ran it on safe mode its works but it dosent save ?

i made

    if(!save_path)
save_path="Players"


but it dosent saves o.o