SA-MP Forums Archive
Getting exact position of trunk - 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 exact position of trunk (/showthread.php?tid=285980)



Getting exact position of trunk - MisterTickle - 26.09.2011

So I'm trying to fine a way of getting the x, y, z of the area right behind the trunk of a vehicle (Which could be used for example in a /trunk command to make sure you are standing by a trunk) Does anyone have a function or any way they could think of doing it as every vehicle is different in size so just making it do y+2 or something like that I would assume would be invalid.


Re: Getting exact position of trunk - Rachael - 26.09.2011

You would have to take into account the angle of the vehicle, and use trig to calculate the co-ordinates of the valid /trunk area.

There are only 211 different vehicles, and of them, perhaps 100 are ~standard~ size cars.
It would not be difficult to write a function that references an array ( that you have to create manually ) which will get the x,y,z of the area behind the vehicle.