23.05.2010, 02:19
I'm making and auto-afk checker
I used Redgies and modified it..
i enter or leave some place and it doesn't work
Any ideas?
NOTE: /back sets AFKMins to 0 and AFK to 0..
I used Redgies and modified it..
Код:
forward CheckAFK(); public CheckAFK() { for(new i = 0; i <= MAX_PLAYERS; i++) { if(PPos[i][1] == 0) { GetPlayerPos(i,PPos[i][0],PPos[i][1],PPos[i][2]); return 1; } new Float:x,Float:y,Float:z; GetPlayerPos(i,x,y,z); if(x == PPos[i][0] && y == PPos[i][1] && z == PPos[i][2]) { AFKMins[i]++; if(AFKMins[i] >= AFKTime) { if(AFK[i] == 0) { AFK[i] = 1; TogglePlayerControllable(i,0); SetPlayerColor(i,COLOR_GREY); oldworld[i] = GetPlayerVirtualWorld(i); SetPlayerVirtualWorld(i,10); new string[256]; format(string,sizeof(string),"[ ! ] %s is now in AFK mode!",GetName(i)); SendClientMessageToAll(COLOR_GREY,string); } } } } return 1; }
Any ideas?
NOTE: /back sets AFKMins to 0 and AFK to 0..