SA-MP Forums Archive
Getting random points in polygon - 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: Getting random points in polygon (/showthread.php?tid=644662)



Getting random points in polygon - StrikerZ - 12.11.2017

Is there a way to get a random point in a polygon?


Re: Getting random points in polygon - OneDay - 12.11.2017

Yes.


Re: Getting random points in polygon - Bolex_ - 12.11.2017

Quote:
Originally Posted by OneDay
Посмотреть сообщение
Yes.
That's it ?


Re: Getting random points in polygon - Eoussama - 12.11.2017

There is this function
PHP код:
GetRandomPointInPolygon(Float:points[],&Float:tx,&Float:ty,maxpoints=sizeof(points)); 
from the 3DTryng include by AbyssMorgan, an amazing include with different functions, very usefull!


Re: Getting random points in polygon - OneDay - 12.11.2017

Quote:
Originally Posted by Bolex_
Посмотреть сообщение
That's it ?
"is it possible" is a yes/no question. "how" is more.


Re: Getting random points in polygon - StrikerZ - 12.11.2017

Quote:
Originally Posted by Eoussama
Посмотреть сообщение
There is this function
PHP код:
GetRandomPointInPolygon(Float:points[],&Float:tx,&Float:ty,maxpoints=sizeof(points)); 
from the 3DTryng include by AbyssMorgan, an amazing include with different functions, very usefull!
Thanks bro, I'm using it.