11.09.2012, 01:38
Nao sei por que o Fail, simplismente ele fica em AFK caso fique parado mais de 1 minuto, penso que o erro esteje na public porem nao detectei o mesmo
pawn Код:
#define TEMPO_AFK 5
new AFK[MAX_PLAYERS];
enum pPos
{
Float:LastX,
Float:LastY,
Float:LastZ,
}
new PlayerLastPos[MAX_PLAYERS][pPos], PlayerAfkTicks[MAX_PLAYERS], Float:PlayerCurrentPos[3];
forward TempoAfk(playerid);
public TempoAfk(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
GetPlayerPos(i, PlayerCurrentPos[0], PlayerCurrentPos[1], PlayerCurrentPos[2]);
if(!floatcmp(PlayerCurrentPos[0], PlayerLastPos[i][LastX]) && !floatcmp(PlayerCurrentPos[1], PlayerLastPos[i][LastY]))
{
PlayerAfkTicks[i] ++;
}
else
{
PlayerAfkTicks[i] = 0;
}
PlayerLastPos[i][LastX] = PlayerCurrentPos[0];
PlayerLastPos[i][LastY] = PlayerCurrentPos[1];
PlayerLastPos[i][LastZ] = PlayerCurrentPos[2];
if(PlayerAfkTicks[i] == TEMPO_AFK*60)
{
AFK[i] = 1;
SendClientMessage(i, VERMELHO_ESCURO, "[ ANTI AFK ] Voce foi Bloqueado de upar por suspeita de Ausencia");
TextDrawShowForPlayer(i,TextAfk1);
TextDrawShowForPlayer(i,TextAfk2);
TextDrawShowForPlayer(i,TextAfk3);
}
}
return 1;
}