General > Developers Corner
Help with Check AFK command?
JamminR:
target_ply in your function is being passed a table due to your command setup.
PlayersArg= table of players, EVEN if you only specify one name.
If you only want one at a time, use PlayerArg in your command setup.
Also, your key check isn't going to work. It only checks one time and moves on, it doesn't give the player(s) any time to respond and will always say they are AFK unless they happen to be already moving when you run this.
You may want to get ideas from a release here on the forum from MrPresident - AntiAFK.
https://forums.ulyssesmod.net/index.php/topic,5963.0.html
It's not quite the same, but will use some of the same checks you want to.
roastchicken:
The way I see it, you should just stick to the derma idea. Looking at your final code, you're still going to have to run it on the client. The input library is client-side only. Not to mention it wouldn't even work if you did put it on the client. (JamminR explained why)
You still have your old derma code, I highly suggest you keep going with that idea. If you're still struggling to understand, I can help you some more.
And no worries, I don't think you're an ass :P
An Error Has Occurred!
array_keys(): Argument #1 ($array) must be of type array, null given
[0] Board index
Go to full version