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?
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.