SA-MP Forums Archive
[Tutorial] 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)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] ColAndreas (/showthread.php?tid=656737)



ColAndreas - Ph0eniX - 22.07.2018

Hi everybody. I would like an tutorial how to use ColAndreas (I never used it or MapAndreas).
I'm creating an submarine script and i want to "stop the submarine" when it "hit" ground under water , ground and other objectes , but idk how to use it . Thanks.


Re: ColAndreas - DeadBrain - 23.07.2018

its so easy basically man function is
CA_RayCastLine(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float, &Float:y, &Float:z);
look at this example :


wall = CA_RayCastLine(myposX, mypoY, myposZ, anotherPlayerposX, anotherPlayerposY, anotherPlayerposZ, &Float, &Float:y, &Float:z);
if(wall != 0) there is an object between you and the player and basically wall is modelid of object id its 0 it mean no objects between you and player the x and y and z pos there are offsets that ray detect meanwhile its coords of points between you and the other player