29.08.2016, 03:05
warning 204: symbol is assigned a value that is never used: "j"
PHP код:
public AFKCheck()
{
static Float:LastPos[MAX_PLAYERS][3];
new Float:x, Float:y, Float:z, string[128];
for(new i, j = GetPlayerPoolSize(); i > -1; i--)
{
if(!IsPlayerConnected(i) || IsAFK[i]) continue; // add here some !IsPlayerSpawned(i)
GetPlayerPos(i,x,y,z);
if(IsPlayerInRangeOfPoint(i,2.0,LastPos[i][0],LastPos[i][1],LastPos[i][2]))
{
if(IsAFK[i] == 0 && ++AFK[i] >= 300)
{
IsAFK[i] = 1;
format(string,sizeof(string),"*%s has gone AFK",GetName(i));//Formats the /do cmd output
SendClientMessageToAll(COLOR_WHITE,string);
}
}
else
{
if(IsAFK[i] == 1 && AFK[i] >= 300)
{
IsAFK[i] = 0;
AFK[i] = 0;
// player is back
}
LastPos[i][0] = x;
LastPos[i][1] = y;
LastPos[i][2] = z;
}
}
return 1;
}

