ID:173757
 
Hello i have a game and when people log out it says they log out but i don't won't to del(src) so they go to z level 2 but is there a way i can make them line up?
There is probably a much more efficient way of doing this, but:

mob/proc/sortofdie()
for(var/turf/T in world)
if(T.z == 2 && T.Enter(src)) // if its on the second z level, and it will allow the mob to enter it (if it doesn't have something blocking its way, such as another player)
src.loc = T // put the mob there
return // exit the proc, the mob should now be happy where it is
In response to DerDragon
DerDragon wrote:
There is probably a much more efficient way of doing this, but:

> mob/proc/sortofdie()
> for(var/turf/T in world)
> if(T.z == 2 && T.Enter(src)) // if its on the second z level, and it will allow the mob to enter it (if it doesn't have something blocking its way, such as another player)
> src.loc = T // put the mob there
> return // exit the proc, the mob should now be happy where it is
>


when they logout they go to usr.loc = locate(5,5,2) is there anyway i can make it so when next person logsout they go to usr.loc = locate(6,5,2) and so on?
In response to CrazyFighter
when they logout they go to usr.loc = locate(5,5,2) is there anyway i can make it so when next person logs out they go to usr.loc = locate(6,5,2) and so on?

mob/proc/gotoheck()
var/turf/T = locate(6,5,2) // turf T to begin at (6,5,2)
again // label to use with goto
for(var/mob/M in T) // if there exists a mob in turf T
T = get_step(T,EAST) // make T the turf one to the right of it
goto again // try the same thing over with this new turf
if(T) // if there is a turf T
src.loc = T // put our mob on turf T
else // if there is not turf T
src << "Sorry, theres no where for you to go" // explain to the mob that theres no where for it to go
return
In response to DerDragon
DerDragon wrote:
when they logout they go to usr.loc = locate(5,5,2) is there anyway i can make it so when next person logs out they go to usr.loc = locate(6,5,2) and so on?

> mob/proc/gotoheck()
> var/turf/T = locate(6,5,2) // turf T to begin at (6,5,2)
> again // label to use with goto
> for(var/mob/M in T) // if there exists a mob in turf T
> T = get_step(T,EAST) // make T the turf one to the right of it
> goto again // try the same thing over with this new turf
> if(T) // if there is a turf T
> src.loc = T // put our mob on turf T
> else // if there is not turf T
> src << "Sorry, theres no where for you to go" // explain to the mob that theres no where for it to go
> return
>


thanks