SA-MP Forums Archive
Kilometer system[+2REP] - 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)
+--- Thread: Kilometer system[+2REP] (/showthread.php?tid=377055)



Kilometer system[+2REP] - Larry123 - 12.09.2012

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


Re: Kilometer system[+2REP] - arvifilter - 14.09.2012

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


Re: Kilometer system[+2REP] - [DOG]irinel1996 - 14.09.2012

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!


Re: Kilometer system[+2REP] - afg - 14.09.2012

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


Re: Kilometer system[+2REP] - Vince - 15.09.2012

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.


Re: Kilometer system[+2REP] - arvifilter - 16.09.2012

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.