ID:149980
 
I want to make it so whe someone enters the game all items they got in a previous game will disapeer

OR

when someone leaves the game items will disapeer, althought i tried this with:
mob/char/Logout()
if(usr.contents == /obj/balls/Soccerball)
usr.contents -= /obj/balls/Soccerball
new /obj/balls/Soccerball(locate(usr.x,usr.y,usr.z))


this didnt work and didnt work with login either, can anyone suggest any other ways? thanks for any help =P~
Logout()
for(var/obj/O in src.contents)
if(O.Move(src.loc)) continue
// else del(O) // Only include if you want the object to be deleted if it can't be moved.
..()

This lets them keep the object if they it can't be moved.
If you want remove the comment line to cause the objects
to be deleted if it can't be moved.
In response to Exadv1
The Login() works the Logout() doesnt, what can i say, ive spent a long time trying to work this one out, looked at a similar post like it on the newbie board, but that person didnt really get a straight answer, this is only a simplified version as u can see from previous posts but not even this will work, Thanks for any help guys n gals =)

mob
Login() // logining in (DUH)
src.loc = locate(2,1,1)
src << "Konin
world << " [usr] Has Entered!"


Logout()
world << "
[src] Has Left!"
In response to Exadv1
The Login() works the Logout() doesnt, what can i say ive spent a long time trying to work this out and im totally totally stumped..this is only a simplified version of the Logout() part and not even that will work. Whats wrong!?! =\ thanks for any help guys/gals!

mob
Login()
src.loc = locate(2,1,1)
src << "Konin"
world << " [usr] Has Entered!"


Logout()
world << "
[src] Has Left!"
In response to Rukawa
Rukawa wrote:
The Login() works the Logout() doesnt, what can i say ive spent a long time trying to work this out and im totally totally stumped..this is only a simplified version of the Logout() part and not even that will work. Whats wrong!?! =\ thanks for any help guys/gals!

mob
Login()
src.loc = locate(2,1,1)
src << "Konin"
world << " [usr] Has Entered!"


Logout()
world << "
[src] Has Left!"
Are you putting the ..() at the end?
Logout()
     world << "blah"
     ..()
In response to Creek
if i do that when i log in it says "[src] has entered" twice and when i logout it says "[src] has entered" again =\