SA-MP Forums Archive
I want to Make a SpeedOMeter but ... - 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: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I want to Make a SpeedOMeter but ... (/showthread.php?tid=88534)



I want to Make a SpeedOMeter but ... - RyDeR` - 27.07.2009

Hello, I want to make a SpeedOMeter but I don't know how to begin Can anybody give me some tips how count the speed in KM/h?
Maybe a Code but please no quote. If you give an example I'll really thank you, I don't want quote from another speedo ..

Thanks in advance,

- [WsR]RyDeR -


Re: I want to Make a SpeedOMeter but ... - paytas - 27.07.2009

d = √ ( (x2-x1)І + (y2-y1)І + (z2-z1)І )



Re: I want to Make a SpeedOMeter but ... - Burridge - 27.07.2009

There are many speedo scripts, why not look at some of them and get some idears?


Re: I want to Make a SpeedOMeter but ... - RyDeR` - 27.07.2009

Quote:
Originally Posted by paytas
There aren't many way to calculate a distance.. So look in other speedo scripts.

d = √ ( (x2-x1)І + (y2-y1)І + (z2-z1)І )
Al right Hmm this code is just crazy Can you give an example how please??


Re: I want to Make a SpeedOMeter but ... - RyDeR` - 27.07.2009

Quote:
Originally Posted by [UF
Burridge ]
There are many speedo scripts, why not look at some of them and get some idears?
You're right but I understand something not: like *4 or someting :S

Sory for SPAM.


Re: I want to Make a SpeedOMeter but ... - paytas - 27.07.2009

To be short and simple:

- GTA SA's distance units are meters.
- Measures distance between the actual player position and the previous player position
- Do it every seconds, you obtain a speed in meters per second (m/s)
- Now to convert to km/h, in one hour there are 3600 seconds and one kilometer is 1000 meters, so you just multiply by 3.6 (3600/1000). 10 m/s = 36 km/h


Re: I want to Make a SpeedOMeter but ... - Westie - 27.07.2009

If you want it really precise, you would need to account for the player's posZ.


Re: I want to Make a SpeedOMeter but ... - RyDeR` - 27.07.2009

Hmm Thank you, I'll try to make one.. If I have problems I'll write it here..


Re: I want to Make a SpeedOMeter but ... - RyDeR` - 27.07.2009

Sory for SPAM, but paytas I want to thank you.. Thank to you I've make the SpeedOMeter With TextDraw.. I'm gona open a topic soon..