15.10.2017, 15:17
test this!
Код:
#include <a_samp>
#include <Pawn.RakNet>
new bool:PlayerAFK[MAX_PLAYERS],TimerEx[MAX_PLAYERS];
forward OnPlayerAFK(playerid);
public OnPlayerConnect(playerid)
{
TimerEx[playerid] = SetTimerEx("OnPlayerAFK", 1000, true, "i", playerid);
return true;
}
public OnIncomingPacket(playerid, packetid, BitStream:bs)
{
PlayerAFK[playerid] = false;
return true;
}
public OnPlayerAFK(playerid) return PlayerAFK[playerid] = true;
public OnPlayerDisconnect(playerid, reason)
{
KillTimer(TimerEx[playerid]);
TimerEx[playerid] = 0;
PlayerAFK[playerid] = false;
return true;
}
/* if(PlayerAFK[playerid] == true){
player is pause
}else{
not in pause
}*/

