Help with AFK
#7

Код:
forward CheckAFK();
public CheckAFK()
{
	new string[50];
	new Float:x,Float:y,Float:z;
	for(new i,g=GetMaxPlayers(); i < g; i++) if(IsPlayerConnected(i) && !IsPlayerNPC(i))
	{
		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);
					format(string,sizeof(string),"[ ! ] %s is now in AFK mode!",GetName(i));
					SendClientMessageToAll(COLOR_GREY,string);
				}
			}
		}else{
			PPos[i][0] = x;
			PPos[i][1] = y;
			PPos[i][2] = z;
		}
	}
	return 1;
}
Reply


Messages In This Thread
Help with AFK - by coole210 - 23.05.2010, 02:19
Re: Help with AFK - by Bayler - 23.05.2010, 02:32
Re: Help with AFK - by coole210 - 23.05.2010, 03:33
Re: Help with AFK - by coole210 - 23.05.2010, 23:55
Re: Help with AFK - by coole210 - 24.05.2010, 16:19
Re: Help with AFK - by coole210 - 26.05.2010, 22:21
Re: Help with AFK - by Jefff - 27.05.2010, 01:09
Re: Help with AFK - by coole210 - 27.05.2010, 02:03

Forum Jump:


Users browsing this thread: 2 Guest(s)