ID:170987
 
Ok my afk system is like this
var/const
afk = FLOAT_LAYER-1
obj/overlay
afk
icon = 'AFK!.dmi'
layer = afk
mob
verb
AFK()
if(afk == 0)
overlays += /obj/overlay/afk
world<<"[usr] has gone afk"
usr.afk = 1
usr.gamestatus = "Afk"
else
if(usr.afk == 1)
overlays -= /obj/overlay/afk
world<<"[usr] has come back from afk"
afk = 0
usr.gamestatus = "Available"


I want to make it to were if someone is idle for more than 5 minutes (doesnt' move/talk) it sets them auto afk.

Any suggestions.
In response to Wizkidd0123
Ok I have client.inactivity in it but how would i make it, automaticly set players that are inactive for 2 minutes afk.??

Here is my afk

mob
verb
AFK()
if(afk == 0)
overlays += /obj/overlay/afk
world<<"[usr] has gone afk"
usr.afk = 1
usr.gamestatus = "Afk"
if(client.inactivity == 100.0)
overlays += /obj/overlay/afk
world<<"[usr] has gone afk"
usr.afk = 1
usr.gamestatus = "Afk"
else
if(usr.afk == 1)
overlays -= /obj/overlay/afk
world<<"[usr] has come back from afk"
afk = 0
usr.gamestatus = "Available"
That is how I have it but it aint working.
In response to Chwgt
2 * 600 = 1800, so set if(client.inactivity == 1800), that SHOULD work if my math is correct, lol
In response to Lenox
Lenox wrote:
2 * 600 = 1800, so set if(client.inactivity == 1800), that SHOULD work if my math is correct, lol

2x900 = 1800
In response to Hell Ramen
Ah crap, my bad, LOL! 1200. :P