SA-MP Forums Archive
How I can calculate by math this? - 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: How I can calculate by math this? (/showthread.php?tid=474660)



How I can calculate by math this? - Riwerry - 09.11.2013

Hello guys, I need to calculate the CENTER of this park place for one police cruiser. And then I need to put cruiser to this CENTER. Here is screen to know, about what am I sayin'




Re: How I can calculate by math this? - ToiletDuck - 09.11.2013

Spawn a vehicle enter and park your vehicle there then type /save
Check the coordinates under My Documents >> GTA >> SAMP >> Positions

Correct me if im wrong


Re: How I can calculate by math this? - Riwerry - 09.11.2013

Well, but I need to put police cruiser to the center of park place, and nobody park like this, I need to calculate it.


Re: How I can calculate by math this? - Pottus - 09.11.2013

Derpy derp... You just need to save the location for it there is no calculations involved.


Re: How I can calculate by math this? - Riwerry - 09.11.2013

I know, but then it won't be like real calculated CENTER of this park slot.


Re: How I can calculate by math this? - Tagathron - 09.11.2013

Riwerry wants it to be perfectly in the center of the place.That's why is he asking for calculations.
Let's say you're looking at that garage floor as it's an quadrilateral/rectangle.
You can save coords of all 4 corners.Then you calculate the diagonal,as you can get range from point A to point B and so for the C.Diagonals will be even,so center of one of them is center of the whole rectangle.
So you need to get the coordinate of the middle of that diagonal

But just park it yourself at the center of it.Why would it need to be perfectly aligned?
If you reall want it in the center that bad,here you go if you don't know how to calculate it:



Re: How I can calculate by math this? - Chrillzen - 09.11.2013

Get in a car first and then save the pos.