GetDistanceBetweenPlayers - 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: GetDistanceBetweenPlayers (
/showthread.php?tid=523920)
GetDistanceBetweenPlayers -
NoahF - 04.07.2014
Hi
How would I make it so if(GetDistanceBetweenPlayers(playerid, CriminalID) > 5)
if the distance between the players is greater than 5 BUT LESS THAN 20, then return 1;?
I am making a /ticket command for cops, and I want the distance that they can ticket them to be greater than 5 but less than 20 so a cop cannot ticket someone on the other side of the map.
Sorry if this is confusing!
Thanks ,Noah
Re: GetDistanceBetweenPlayers -
Vince - 04.07.2014
pawn Код:
if(5.0 < GetDistanceBetweenPlayers(playerid, CriminalID) < 20.0)
Recommended to always add the .0 when working with floats.
Re: GetDistanceBetweenPlayers -
NoahF - 04.07.2014
Thank you!