05.08.2018, 19:02
Quote:
|
Код:
new Float:AfkPos[MAX_PLAYERS][3];
new Float:GPos[4];
SetTimer("CheckAFK",5000,true);
function CheckAFK()
{
GetPlayerPos(i, GPos[0],GPos[1],GPos[2]);
if(AfkPos[i][0] == GPos[0] && AfkPos[i][1] == GPos[1] && AfkPos[i][2] == GPos[2]) AFKTime[i] += 5;
else
{
if(AFKTime[i] == 30) //Player is not moving for 30 seconds.. also don't forget to add 'return 1;' in the end
GetPlayerPos(i, AfkPos[i][0], AfkPos[i][1], AfkPos[i][2]);
}
return 1;
}
|
Quote:
|
Also there is a way to detect if a player pressed ESC or minimized his game |

