Player position check
#4

Quote:
Originally Posted by NeXTGoD
Посмотреть сообщение
Код:
new Float:AfkPos[MAX_PLAYERS][3];
new Float:GPos[4];

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
Do not use this code. Not only will this not work since this is a clear copy and paste, but also, this is very unoptimized and... just terrible in general.


Quote:

Also there is a way to detect if a player pressed ESC or minimized his game

There is not. There is however a possibility to detect when the server has stopped receiving packets from the client, but the client is still connected, might be what you refer to.
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)