SA-MP Forums Archive
Check player race position - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Check player race position (/showthread.php?tid=540779)



Check player race position - qmnty - 07.10.2014

How to check or get player position on race??


I have tried using GetDistance in OnPlayerUpdate , but when the players change positions .
Example : from 1 to 2 or vice versa .
Textdraw on position players had continued to decrease or increase .
I want to grow only one position player numbers only .

How do I do that ?

Thank you.


Re: Check player race position - (SF)Noobanatior - 07.10.2014

the easy way is to do it, is when they go through the checkpoint or you could use something like (see below) off a timer
Код:
stock GetPlayerDistanceToPointEx(playerid,Float:x,Float:y,Float:z) {//By Sacky (Edited by Smugller)
	new Float:x1,Float:y1,Float:z1;
	new Float:dis;
	GetPlayerPos(playerid,x1,y1,z1);
	dis = floatsqroot((x-x1)*(x-x1)+(y-y1)*(y-y1)+(z-z1)*(z-z1));
	return floatround(dis);
}



Re: Check player race position - qmnty - 19.10.2014

Thanks...