SA-MP Forums Archive
Car Shooter - 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: Car Shooter (/showthread.php?tid=449158)



Car Shooter - magnetec - 07.07.2013

Hi
http://www.youtube.com/watch?feature...&v=UVD6ugnyl68
How can I do this in the video system of the vehicle hit an object, how do I know that?
Waiting for your help.


Re: Car Shooter - magnetec - 08.07.2013

Help please


Re: Car Shooter - Cjgogo - 08.07.2013

You mean when the missile hits an object, not when the vehicle hits an object, right?


Re: Car Shooter - magnetec - 08.07.2013

Yes, the car will explode when it hits.


Re: Car Shooter - magnetec - 08.07.2013

Quote:
Originally Posted by Gamer_Z
Посмотреть сообщение
You can get the vehicle size (array released somewhere on this forum - SEARCH) and vehicle position (GetVehiclePos) and vehicle rotation matrix from GetVehicleRotationQuat (and creating a rotation matrix with GetVehicleMatrix include), then you can check if a line goes through the sphere the vehicle occupies.

http://stackoverflow.com/questions/2...sects-a-sphere
http://gamedev.stackexchange.com/que...here-intersect
http://www.realtimerendering.com/intersections.html

And bytheway.. it's called "Ray-Sphere Intersection".
Thanks.