ID:175836
 
When a player logs out i want it to check to see if theres a door under there key. This is what i have.
mob/characters
Logout()
world << "[src] Logs out!"
for(var/obj/Door/D in world)
if(D.owner == src.key)
world << "mobs door!"
var/obj/forsale/S
new S(D.loc)
del(D)
else
..()
del(src)


well somthin like that the tabs are messed up..but just here.*the code between the stars is the only prob i think*
ty hendrix
HendrixandCamo wrote:
When a player logs out i want it to check to see if theres a door under there key. This is what i have.
<code> mob/characters var/K Logout() world << "[usr] Logs out!" for(var/obj/Door/D in world) if(D.owner == usr.key) world << "mobs door!" var/a = new/obj/sale(D.loc) del D a.density = 0 else return </code>
In response to Mrhat99au
Why doesnt anyone understand that i need a:density = 0
it has to be like that, it dont have to be density i needed somethin to call the a var and my indentation is fine just look at the content in the code.



Hendrix
Two problems:

  • del(src) is indented too far, so it's part of the for loop.
  • "else ..()" is totally meaningless here; get rid of it.

    Lummox JR