Player position check
#3

Код:
new Float:AfkPos[MAX_PLAYERS][3];
new Float:GPos[3];

SetTimer("CheckAFK",5000,true);

function CheckAFK()
{
	GetPlayerPos(i, GPos[0],GPos[1],GPos[2]);
	if(AfkPos[i][0] == GPos[0] && AfkPos[i][1] == GPos[1] && AfkPos[i][2] == GPos[2]) AFKTime[i] += 5;
	else
	{
		if(AFKTime[i] == 30) //Player is not moving for 30 seconds.. also don't forget to add 'return 1;' in the end
   		GetPlayerPos(i, AfkPos[i][0], AfkPos[i][1], AfkPos[i][2]);
	}
	return 1;
}
Also there is a way to detect if a player pressed ESC or minimized his game
Reply


Messages In This Thread
Player position check - by ,TomY' - 05.08.2018, 18:32
Re: Player position check - by DBZdabIt3Bro7 - 05.08.2018, 18:49
Re: Player position check - by NeXTGoD - 05.08.2018, 18:59
Re: Player position check - by DBZdabIt3Bro7 - 05.08.2018, 19:02
Re: Player position check - by NeXTGoD - 05.08.2018, 19:05
Re: Player position check - by DBZdabIt3Bro7 - 05.08.2018, 19:07
Re: Player position check - by NeXTGoD - 05.08.2018, 19:16
Re: Player position check - by ,TomY' - 05.08.2018, 20:25
Re: Player position check - by DBZdabIt3Bro7 - 05.08.2018, 20:41
Re: Player position check - by ,TomY' - 06.08.2018, 08:14

Forum Jump:


Users browsing this thread: 1 Guest(s)