Save Load Delete - Acting stupid.. in Developer Help
|
|
Well, my code has been acting stupid and I can't seem to find anyway to have it work.. Help out, please:
This is part of my Login code. The rest has nothing to do with Login, load, etc.
mob/Login() if(verified) src.client.control_freak=0 src.ToggleChat() players+=src src << "Logging in and checking verification.." src << "Server verified." src << "Server Link: byond://[world.address]:[world.port]" world << "[src.key] has logged on." src.icon='pregnant_woman.dmi' src.icon_state="" if(fexists("Save Files/[src.key].sav")) src.Logginer() else src.AdminGive() src.loc=locate(250,250,1)
|
If the person has a file then it loads logginer where they have the choice to Load or Delete:
Logginer() if(fexists("Save Files/[src.key].sav")) switch(input("You have a save file. What do you wish to do?","Save File") in list ("Load","Delete")) if("Load") src.Load() if("Delete") switch(input("Are you sure about deleting your file?","Check") in list ("Yes","No")) if("Yes") var/savefile/F=("Save Files/[src.key].sav") del(savefile/F) src.Login() if("No") src.Logginer()
|
This is my load and save code.
Load() var/savefile/F=file("Save Files/[src.key].sav") F["V"] << src.verbs F["xco"] << src.x F["yco"] << src.y F["zco"] << src.z usr.client.Export(F)
Save() var/savefile/F= new("Save Files/[src.key].sav") F["V"] >> src.verbs F["xco"] >> src.x F["yco"] >> src.y F["zco"] >> src.z usr.client.Import(F) src<<"Saved."
|
Now, I already know I can make these codes shorter. I just added on F[""] because it was not working.. so.. eventually it became longer. I have a code that works but you cannot delete. You can only overwrite. I'd appreciate it if somebody helped out. My code seems to be acting really... stupid.
|