ID:263543
 
Code: (Load TURF)
turf/main
Load_CHAR
name = "Load Character"
density = 1
Click()

switch(alert("Load Character", "Please choose a slot!","Slot 1","Slot 2","Slot 3","Cancel"))
if("Slot 1")
if(fexists("Players/[usr.key]/Save1.sav"))
var/savefile/s1=new("Players/[usr.ckey]/Save1.sav")
s1["mob"]>>usr.client.mob
s1["x"]>>usr.client.mob.x
s1["y"]>>usr.client.mob.y
s1["z"]>>usr.client.mob.z
usr.savefile1 = 1
else
usr << "<big><font color = red>You dont have any character saved in this slot"
return
if("Slot 2")
if(fexists("Players/[usr.key]/Save2.sav"))
var/savefile/load
load = new ("Players/[usr.key]/Save2.sav")
load["mob"] >> usr.client.mob
load["x"] >> usr.client.mob.x
load["y"] >> usr.client.mob.y
load["z"] >> usr.client.mob.z
usr.savefile2 = 1
else
usr << "<big><font color = red>You dont have any character saved in this slot"
return
if("Slot 3")
if(fexists("Players/[usr.key]/Save3.sav"))
var/savefile/load
load = new ("Players/[usr.key]/Save3.sav")
load["mob"] >> usr.client.mob
load["x"] >> usr.client.mob.x
load["y"] >> usr.client.mob.y
load["z"] >> usr.client.mob.z
usr.savefile3 = 1
else
usr << "<big><font color = red>You dont have any character saved in this slot"
return
if("Cancel")
return

Auto Save Proc
        Auto_Save()
set background = 1
src.afk_time ++
src.client.Save()
src << "GAME SAVED!"
spawn(1500) src.Auto_Save()



Save Proc
        Save()
if(usr.savefile1)
var/savefile/s1 = new("Players/[src.mob.key]/Save1.sav")
s1["mob"] << src.mob
s1["x"] << src.mob.x
s1["y"] << src.mob.y
s1["z"] << src.mob.z
if(usr.savefile2)
var/savefile/s2 = new("Players/[src.mob.key]/Save2.sav")
s2["mob"] << src.mob
s2["x"] << src.mob.x
s2["y"] << src.mob.y
s2["z"] << src.mob.z
if(usr.savefile3)
var/savefile/s3 = new("Players/[src.mob.key]/Save3.sav")
s3["mob"] << src.mob
s3["x"] << src.mob.x
s3["y"] << src.mob.y
s3["z"] << src.mob.z


Problem description:

Dream Maker:
DBZ Legendary Saiyans.dmb - 0 errors, 0 warnings
0 errors o.0


I Click in Load Turf and this error apper!:

runtime error: Cannot read null.client
proc name: Click (/turf/MAIN/Load_CHAR/Click)
source file: Character Creation.dm,210
usr: null
src: Load Character (79,78,3) (/turf/MAIN/Load_CHAR)
call stack:
Load Character (79,78,3) (/turf/MAIN/Load_CHAR): Click(Load Character (79,78,3) (/turf/MAIN/Load_CHAR))



Where is the error?
The error is on line 210 of Character Creation.dm. Go to that file and find the line (use ctrl+G and type in 210), then show us where it is on here via a comment, so we can help you easier.

Also, the error is because somewhere you're either not passing a mob as an argument, or src isn't a mob in the case you think it is.
In response to Popisfizzy
Here the line 210 (Character Creation.dm)
                        s1["x"]>>usr.client.mob.x


please help =/
In response to Mystical Style
I meant could you show us where that was at with the surrounding code, by putting in a comment where it's at. For example:
proc/x()
var/x = 1
world << x + x
return y //Error's here
In response to Popisfizzy
src is the turf
usr is the user
                        s1["x"]>>usr.client.mob.x

i need use usr.client.mob.x or usr.mob.x????


sorry for my bad english.. I am braziliam ^^
In response to Mystical Style
All you need is usr.x, if it's a verb. If you're using a procedure, then avoid using usr.
In response to Popisfizzy
Fixed!Thx for help!!!