ID:263877
 
Code:
see this is suppose to be my log out code but for sum reason when u logout it dont says u logged out or save ur game
client
Del()
if(src.banned)
return..()
if(!src.mob)
return..()
else
if(!src.banned)
world << "<b><font color = yellow>Info:<font color = silver>([src]) has logged off!"
src.SaveZ()
del(mob)
return..()

Problem description:
y this dont work? T.T
0.0 no1 knows y?
         if(!src.mob)
return..()


By the time client/Del() is called, I believe the mob is already removed from your client's mob var, thus returning ..()

I could be wrong though.
In response to Iuss
can u explain wats wrong or how to fix it?
Pirata Inmortal wrote:
Code:
see this is suppose to be my log out code but for sum reason when u logout it dont says u logged out or save ur game
> client
> Del()
> if(src.banned)
> return..()
> if(!src.mob)
> return..()
> else
> if(!src.banned)
> world << "<b><font color = yellow>Info:<font color = silver>([src]) has logged off!"
> src.SaveZ()
> del(mob)
> return..()
>

Problem description:
y this dont work? T.T


Im thinking you should use an extremely simple built-in proc called Logout()

In response to ChaoticHatake
For the billionth time: Del() is the proper proc to use for when a client DISCONNECTS FROM THE GAME. Logout() is not. Logout() will usually work, but telling people that they're wrong when they're using what they SHOULD be using just makes you look stupid.
In response to Garthor
OMG easy dude im pretty new and this is my first time, now i know i wont use it

P.S Ive never been a fan of yours anyways...


Twista
In response to Iuss
The mob var will still be valid within client/Del() unless if the mob was deleted, forcing the player to log out. If a player disconnects by closing the DS window, then the mob var will be valid, even if it's deleted in mob/Logout() (which should come after the client is deleted).
In response to ChaoticHatake
I'm not here for popularity contests, I'm here for correcting people's mistakes.
In response to Garthor
Ok w/e

This is going offtopic



Dont reply unless your helping to fix the code
Pirata Inmortal wrote:
Code:
see this is suppose to be my log out code but for sum reason when u logout it dont says u logged out or save ur game
> client
> Del()
> if(src.banned)
> return..()
> if(!src.mob)
> return..()
> else
> if(!src.banned)
> world << "<b><font color = yellow>Info:<font color = silver>([src]) has logged off!"
> src.SaveZ()
> del(mob)
> return..()
>

Problem description:
y this dont work? T.T


I maybe wrong but isnt it del(src) ?
i tried the logout() but when i use it buggs my save/load proc


mob
proc
SaveZ()
var/savefile/save
save = ("players/[usr.key]")
save["mob"] << usr
save["x"] << usr.x
save["y"] << usr.y
save["z"] << usr.z
save["verbs"] << usr.verbs
usr << "<font color=red>Your game has been saved!"
Load()
if(fexists("players/[usr.key].sav"))
var/savefile/load = new ("players/[usr.key].sav")
load["mob"] >> usr
load["x"] >> usr.x
load["y"] >> usr.y
load["z"] >> usr.z
world<<"<font color=green>[usr] has logged in!"