Kilometer system[+2REP]
#1

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
Reply
#2

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
Reply
#3

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!
Reply
#4

Quote:
Originally Posted by arvifilter
Посмотреть сообщение
you'll need +16gig ram to run for 4 cars
Mega facepalm...
Reply
#5

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.
Reply
#6

Quote:
Originally Posted by afg
Посмотреть сообщение
Mega facepalm...
Bro,Just try it a non Bugged system of this needs super high performance(every second the timer must check player's position and the traveled distance by the car's angle and so many other things then after calculations it must be added to the variable and shown to the player)
making a bugged system isn't that hard.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)