SetTimer("AFKCheck", 1000, true);
Where do you have this line placed?:
pawn Код:
|
new Float:AFKPos[MAX_PLAYERS][3], AFK[MAX_PLAYERS]; // At the top of your script.
public OnPlayerConnect(playerid)
{
AFK[playerid] = 0;
SetTimerEx("AFKCheck", 1000, true, "i", playerid);
return 1;
}
forward AFKCheck(playerid);
public AFKCheck(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, AFKPos[playerid][0], AFKPos[playerid][1], AFKPos[playerid][2])) AFK[playerid]++;
if(AFK[playerid] >= 60)
{
new string[65];
format(string, sizeof(string), "%s Nejudejo minute ir gavo jobana kicka.", GetPlayerNameEx(playerid));
SendClientMessage(playerid, GREEN, string);
//SendClientMessageToAll(COLOR_WHITE, string);
ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, "AFK", "TESTINAMSUKOS", "Aљ gryћau", "Atљaukti");
//Kick(playerid); // Note that if you want to be able to see messages, use a delayed kick.
AFK[playerid] = 0;
return 1;
}
GetPlayerPos(playerid, AFKPos[playerid][0], AFKPos[playerid][1], AFKPos[playerid][2]);
return 1;
}