Forum




Herausfinden ob jemand AFK ist
3 replies



1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
-- optional minTime - minimum idle time in seconds -- returns table with AFK players, IDs are stored as values function getPlayersAfk(minTime) local afkPlayers = {} local minTime = minTime or tonumber(game("mp_idletime")) local players = players(0, "table") for i = 1, #players do if player(players[i], "idle") > minTime then table.insert(afkPlayers, players[i]) end end return afkPlayers end


Not tested, up to you

--- Tut mir Leid, ich dachte du hättest die Frage auf Englisch gestellt...


ich muss mal schauen ob die specs auch als idle gelten wenn sie nichts machen
So oder so wäre es aber besser Zeile 6 einfach zu ersetzen durch
local players = player(0,"tableliving")
So werden überhaupt nur lebende Spieler überprüft.



