General > Off-Topic

Pause UTime timer for specific players

(1/1)

imtiara:
Hiya! So i'm making a afk detection script that basicly tells the whole server that this user is now afk etc.
However, I would love to pause the utime counter for the afk player so they wont idle just to get more playtime on my server.
Is this possible in any way? Thanks!

-Tiara

JamminR:
No pause.
UTime, at least Megiddo's original version, and I presume every other "improved" one made after, uses oldtime + playerleft system time - playerjoined system time.

There is no timer other than the computer clock.

(The currently only way) I imagine you could prevent idlers from being counted would be similiar to what UTime does now.
Keep a running cumulative variable of a players afk time during the session.
Then actually modify the sh_utime file function, likely the GetUTimeTotalTime to subtract totalidle of the player.
oldtime + playerleft system time - playerjoined system time - session_afk

Navigation

[0] Message Index

Go to full version