Posts: 168
Threads: 57
Joined: Oct 2009
Reputation:
0
Hello
I would like to do a taximeter.
I want, that if player has passed 1KM then the taxi value goes up, you know.
I know that something with this: GetPlayerDistanceFromPoint | But what? How it checks?
I give you +2REP
Posts: 39
Threads: 5
Joined: Dec 2011
Reputation:
0
if you want this system to work with out bug,you'll need +16gig ram to run for 4 cars
you can use onplayer update and get player's position and then add a one sec timer and check pos again,and then add the changed pos value to the taximeter's value.but laggs a lot so.. not recommended
Posts: 1,469
Threads: 62
Joined: Jan 2010
Reputation:
0
Thinking on that in real taxis the value is increasing even it is stopped with engine turned on I suggest you make a timer and repeat it each 5 seconds, also you can make it more real checking its velocity and add more if it is high. This isn't the best answer but what you are asking for wouldn't be really accurate. At least I think so.
Good luck!
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Distance = Speed x Time. Keep that in mind.
If you have a speedometer that updates every second you can use this to calculate the traveled distance. Of course, the value returned by the GetPlayerSpeed functions is in Km/h, so divide by 3600 to get Km/s. Have a global variable. Each time the timer updates, add the calculated value to this variable.
Kind of roughly explained. Hope you get it.