SA-MP Forums Archive
Random Z coords with ColAndreas - 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: Random Z coords with ColAndreas (/showthread.php?tid=652251)



Random Z coords with ColAndreas - Nyzenic - 06.04.2018

hello

im trying to generate 200+ random objects/items on the map and i cant do that by randomizing Z coords or by getting all the coords manually
i tried to randomize XYZ coords then i saw some items spawn midair(due to the random Z coords)
How do I generate random Z coords on the ground with ColAndreas?

thanks


Re: Random Z coords with ColAndreas - AdamsLT - 06.04.2018

Either

PHP Code:
CA_FindZ_For2DCoord(Float:xFloat:y, &Float:z
or make up a more elaborate function with ray casting.
https://github.com/Pottus/ColAndreas/wiki/Functions

Can't really provide an example as I haven't tried it but it should work, I believe.


Re: Random Z coords with ColAndreas - Nyzenic - 06.04.2018

Thanks. I'm gonna try that out