Author Topic: GetPlayerSpeed  (Read 3644 times)

0 Members and 1 Guest are viewing this topic.

Offline Jancis71

  • Street Thug
  • *
  • Posts: 21
    • View Profile
GetPlayerSpeed
« on: July 28, 2010, 08:54:09 pm »
I need help with GetPlayerSpeed function, i have no idea how can i do this.
« Last Edit: July 28, 2010, 08:59:51 pm by Jancis71 »

Offline [AoD]NC

  • VC:MP Beta Tester
  • VC:MP Veteran
  • *
  • Posts: 616
  • AoD forever!
    • View Profile
    • KURWA MAĆ
Re: GetPlayerSpeed
« Reply #1 on: July 29, 2010, 03:59:09 am »
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 :).

Offline Jancis71

  • Street Thug
  • *
  • Posts: 21
    • View Profile
Re: GetPlayerSpeed
« Reply #2 on: July 29, 2010, 11:43:14 am »
There would be SetTimerEx very useful, thanks for answer.