ID:164107
 

This is the code i have its not booting players who are inactive i think it is because i do not have a Logout code set up i need help it doesn't tell me how to define how to logout it just says Logout() i tried to do how my coder did the login but as log out but that didn't work PLZ help.




world
New()
..()
while(world)
sleep(10)
for(var/mob/M in world)
if(M.client)
if(M.client.inactivity >= 1)//set the time
M.Logout()
Identation problem, put the for(var/mob/M) under while()
In response to Kazekage
But what about sleep?!? would that got under the For(var/mob/ ?
New()
..()
while(world)
sleep(10)<----------
for(var/mob/M in world)
if(M.client)
if(M.client.inactivity >= 1)//set the time
M.Logout()
In response to Jason515
Instead of M.Logout() try "del(M)"
In response to Foster AJ
That doesn't matter. The thing is he has a for() loop outside the while() loop, meaning that the for() would be called after the while() is done, which is when the game has been shut down.. he just needs to indent everything in by one so the for() is within the while() for it to be called.
world
New()
.=..()
while(src)
sleep(10)
for(var/mob/M in world)
if(M.client)
if(M.client.inactivity>=1)
M.Logout()

or
world
New()
.=..()
spawn() BootCheck()
proc/BootCheck()
for(var/mob/M in world) if(M.client && M.client.inactivity>=1) M.Logout()
spawn(10) BootCheck()
In response to GhostAnime
alright thanks i'll try it ^_^ if it doesn't work i'll come back crying like a 12 yr old girl lmao.

*~*edit*~* omg thank you but will the code boot me as well because i went in and it's not booting it just says () was kicked for being idle while not kicking me
In response to Jason515
It is now spamming that ()was kicked for being idle and no matter what i change the time to it keeps spamming it
In response to Jason515
Thats because the inactivity is ready in 1/10 of a second. How many seconds do you want them to be idle before they are booted? If 5 seconds 5 * 10 = 50. And so fourth.
In response to L3mm0nX
i changed from 1second to 360 which is 5 mins butit keeps spamming it
In response to Jason515
Which code are you using? I recommend using this one

world
New()
.=..()
spawn() BootCheck()
proc/BootCheck()
for(var/mob/M in world) if(M.client && M.client.inactivity>=1800) M.Logout()
spawn(10) BootCheck()


This boots inactive people every 3 minutes.
In response to L3mm0nX
I was using the one i had posted i'll try this one and see if it works.
In response to Jason515
I just got an undefined proc when i tried to do add it to the code
In response to Jason515
Thats because you add it exactly as I put it.
In response to L3mm0nX
lol i typed it all in piece by piece. but this whole thing is new to me v_v


:edit: i think i got it now there was a few indentation errors
and typing but it compiled so i'm going to go test it now
In response to Jason515
Its still doing it but i think it is because its announcing for the world and i didn't attach it to anything,

here is the code

world
New()
.=..()
spawn() BootCheck()

proc
BootCheck()
for(var/mob/M in world) if(M.client && M.client.inactivity>=30) M.Logout()
spawn(10)BootCheck()
world<<"<font size=1><font color=green>Info:<font color=white>([src])<font color=red>has been kicked for being idle"


i can't get it not to spam when its like this

:edit: looking at it like this i really did something wrong v_v
In response to Jason515
Well for one your telling the world that the world has been kicked for being idle.

You should know what to do with this otherwise I recommend you reading and understanding the DM guide before going any further:
for(var/mob/M in world) if(M.client && M.client.inactivity>=300) {world<<"Info:([M]) has been kicked for being idle";M.Logout()}
In response to L3mm0nX
OMG THANK YOU THANK YOU THANK YOU.
In response to Jason515
I added the code and it works no more spamming that i booted the world lmao. but it doesn't boot when time is up i think it might be because i don't have a Logout() set up when the players leave no one is notified that they leave could that be the issue here.
In response to Jason515
Well reason it doesnt boot is because you probably dont have del(src) in your logout proc. What I usually do is override the logout proc and do something similar to this:

mob
Logout()
src.Save() //your saveproc here to save their character
del(src)
..()