Count kilometers
#1

Hello, i want to save the kilometers driven by a player in all vehicles. I DONT wanna save VEHICLE kilometers, i need to calculate and save how many km's a player driven with a vehicle, doesnt matter which.
How to?
Reply
#2

Check this FS out: https://sampforum.blast.hk/showthread.php?tid=404367
Reply
#3

Please read:

Quote:

I DONT wanna save VEHICLE kilometers, i need to calculate and save how many km's a player driven with a vehicle, doesnt matter which

Reply
#4

Bump.
Reply
#5

It doesn't take a coding legend to figure out that you get the value from that filterscript, and count it each time the player gets in and out of the car...
Reply
#6

Distance = Speed x Time. Decide if you want to store distance in meters or kilometers. Set repeating timer for 1 second. Get speed in km/h. Convert to km/s (3600 seconds in an hour, so divide speed by 3600) or m/s (convert kilometers to meters (multiply by 1000) and then divide by 3600). Add value to player stat.
Reply
#7

Quote:
Originally Posted by Vince
Посмотреть сообщение
Distance = Speed x Time. Decide if you want to store distance in meters or kilometers. Set repeating timer for 1 second. Get speed in km/h. Convert to km/s (3600 seconds in an hour, so divide speed by 3600) or m/s (convert kilometers to meters (multiply by 1000) and then divide by 3600). Add value to player stat.
I think it would be better to get their position each second and if it is more than a certain tolerance (0.1 meters example) when the next position update takes place then that distance would be added to the total.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)