SA-MP Forums Archive
IsPlayerInPolygon - Somehow possible? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: IsPlayerInPolygon - Somehow possible? (/showthread.php?tid=196058)



IsPlayerInPolygon - Somehow possible? - BloodyEric - 04.12.2010

Hey folks,
I just wanted to know if there is any way to check whether the player is in a polygon. The only way in my mind is to split it in rectangles and use IsPlayerInArea - but this doesn't sound really efficiently.

Anyone?


Re: IsPlayerInPolygon - Somehow possible? - Ash. - 04.12.2010

Hmm...
I cant think of a way, but, why a polygon?


Re: IsPlayerInPolygon - Somehow possible? - BloodyEric - 04.12.2010

I want to define a special place on the map, where players can move...but rectangles are too inexactly for this.


Re: IsPlayerInPolygon - Somehow possible? - xxmitsu - 04.12.2010

well, could you create that poligone from multiple small rectangles ?

The use something like

if(IsPlayerInArea(1) || IsPlayerInArea(2) || IsPlayerInArea(3)) ...etc ?


Re: IsPlayerInPolygon - Somehow possible? - PowerPC603 - 05.12.2010

How about a small circle?
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint