What's wrong with this? What it does is when a user logs in for the first time it runs iconsave() and saves the icon_state of the user and then when the user logs in again it starts him/her with that icon.
proc/iconsave()
var/savefile/F = new("iconss.sav")
F["[usr.icon_state]"] << usr.icon_state
proc/CheckIcon()
var/savefile/F = new("iconss.sav")
var/checking
F["[usr.icon_state]"] >> checking
F["[usr.icon_state]"] << checking
if(!checking)
spawn() usr.icon_chose()
usr << "hi"
else
usr.icon_state = checking
usr << "hello"</<>
ID:150100
![]() Dec 13 2001, 3:46 am
|
|
I've tried everything and gotten this far...
mob/var registered iconss proc/SaveIcon() var/savefile/S = new("Icons.sav") S["[ckey(usr.key)]/[usr.registered]"] << 1 S["[usr.key/usr.icon_state]"] << usr.icon_state usr << "Your icon is saved!" proc/LoadIcon() var/savefile/S = new("Icons.sav") S["[ckey(usr.key)] >> usr.registered"] >> usr.registered if(usr.registered) S["[ckey(usr.key)]/[usr.icon_state]"] >> usr.icon_state usr << "Your icon has been loaded!" else usr << "You are not registered; we cannot load your icon." usr.icon_chose() // was that what the proc was called? mob/Login() LoadIcon() ..() mob/Logout() SaveIcon() ..() It's compiling fine but, not running so well, when reboot world, I get this: runtime error: Undefined operation proc name: SaveIcon (/proc/SaveIcon) usr: Threefours (/mob) src: null call stack: SaveIcon() Threefours (/mob): Logout() |
Why didn't you use the code I provided? You made some strange adaptations of it... try reworking it a second time and think hard about what you are doing.
-Lord of Water |
all those src.mob....s where giving me errors! I don't know what's wrong! I've never been good at savefiles, I just don't understand um. *starts to cry loudly*
|
src.mob will only work if you leave the it a /client/proc. You changed it and got errors. Understandable! If you don't want src.mob, change it to usr.mob. Maybe it won't accept usr.mob. If it won't, set up a different system:
proc/SaveMob() I hope you can sort this out-- your errors are mainly small ones that can be fixed if you comb over your code. Note: I trust that you are experienced enough to debug code. If not, my best advice is to do some other things and come back to this later. -Lord of Water |
I hope I helped!