• Welcome to Vice City Multiplayer.
 

GetPlayerSpeed

Started by Jancis71, July 28, 2010, 07:54:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jancis71

I need help with GetPlayerSpeed function, i have no idea how can i do this.

[AoD]NC

First of all say if you want to check one-two times the speed via a command or create a speedometer?

A sample GetPlayerSpeed() can be done by creating a new function that:
1. Saves your pos now.
2. Waits a while e.g. 500 ms.
3. Takes the saved pos and the pos now.
4. Some math (X1 - X2 and probably ^2).
5. Return the speed. However if you would like to see the speed in kmh, you will need maybe everything x4.

Maybe this can be helpful :).

Jancis71

There would be SetTimerEx very useful, thanks for answer.