29.07.2018, 01:41
http://forum.sa-mp.com/showpost.php?...09&postcount=7
Ou:
Ou:
PHP код:
SetTimerEx("", 1000, true, "i", playerid);
forward (playerid);
public (playerid)
{
if (!IsPlayerMoving(playerid))
{
SetPVarInt(playerid, "AFK", GetPVarInt(playerid, "AFK") + 1);
if (GetPVarInt(playerid, "AFK") >= 60) // 60 segundos sem se mover.
Kick(playerid);
}
else
SetPVarInt(playerid, "AFK", 0);
}
stock IsPlayerMoving(playerid)
{
new
Float:x,
Float:y,
Float:z;
if (GetPlayerVelocity(playerid, x, y, z)) {
if (!floatcmp(x, 0.0) && !floatcmp(y, 0.0) && !floatcmp(z, 0.0))
return 0;
}
return 1;
}