31.07.2012, 15:01
Frineds here is my auto afk but it not working properly.THe code is below
Code:
#include <a_samp> #define FILTERSCRIPT new AFK[MAX_PLAYERS]; public OnGameModeInit() { SetTimer("CheckAFK", 1000, true); } // ... public OnPlayerUpdate(playerid) { if(AFK[playerid] > 3) { // This player just came back from being AFK } AFK[playerid] = 0; } // ... forward CheckAFK(); public CheckAFK() { for(new i = 0; i != MAX_PLAYERS; i++) { if(!IsPlayerConnected(i)) continue; AFK[i] ++; if(AFK[i] == 3) { } } }