Помогите убрать афк систему на сервере вот код:
Code
forward CountEx();
public CountEx()
{
OtherTimer();
for(new x = 0; x < MAX_PLAYERS; x++)
{
if(IsPlayerConnected(x))
{
if(PlayerEx[x][ChekEx] == PlayerEx[x][TickEx])
{
if(PlayerEx[x][pSpawnEx] == true)
{
PlayerEx[x][AFKEx] = true;
}
}
PlayerEx[x][ChekEx] = PlayerEx[x][TickEx];
}
}
return 1;
}
public AFKProcessor()
{
for(new x = 0; x < MAX_PLAYERS; x++)
{
if(IsPlayerConnected(x))
{
if(PlayerEx[x][ChekEx] < PlayerEx[x][TickEx])
{
if(PlayerEx[x][AFKEx] == true)
{
PlayerEx[x][VarEx] = 0;
PlayerEx[x][AFKEx] = false;
}
}
if(PlayerEx[x][AFKEx] == true)
{
PlayerEx[x][VarEx]++;
}
if(PlayerInfo[x][pAdmin] <= 0)
{
if(PlayerEx[x][VarEx] > 300)
{
OnPlayerUpdateRL(x);
SendClientMessage(x,COLOR_REDD,"[AFK]: Âû áûëè îòñîåäåíåíû îò ñåðâåðà");
Kick(x);
PlayerEx[x][VarEx] = 0;
}
}
if(PlayerEx[x][VarEx] > 1)
{
new stringF[50];
format(stringF,sizeof(stringF),"[AFK] [%s ñåêóíä]",Convert(PlayerEx[x][VarEx]));
SetPlayerChatBubble(x, stringF, COLOR_GREEN, 30.0, 1200);
}
}
}
return 1;
}