05.09.2013, 04:32
That's weird, it works fine for me. Here's what I have:
pawn Код:
#define MAX_IDLE_TIME 15 // 15 minutes
new PlayerAfkTicks[MAX_PLAYERS];
new AFK[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
PlayerAfkTicks[playerid] = 0;
AFK[MAX_PLAYERS];
return 1;
}
public OnGameModeInit()
{
SetTimer("OneSecond", 1000, 1);
return 1;
}
forward OneSecond();
public OneSecond()
{
for(new x = 0; x < MAX_PLAYERS; x++)
{
new maxtime = floatround((MAX_IDLE_TIME * 60), floatround_ceil);
if(PlayerAfkTicks[x] >= maxtime)
{
AFK[x] = 1;
}
}
return 1;
}