Trip-o-Meter - Save vehicle KM! -
The_Moddler - 10.11.2010
Trip-o-Meter V1.0
Hey, I made this script, that saves your vehicle kilometers and meters, it's really usefull for RP servers.
Each vehicle has it's own kilometers, you can change the vehicle KM by going to the vehicles folder, and changing it.
Each file name is a number, representing the vehicle id, the file looks like this:
pawn Код:
metros=4 //Meters
kilometros=5452 //Kilometers
Change kilometers to what ever you want, but it can't exeed 999999 kilometers, same for meters, but meters can't exeed 9.
Usage:
Just extract those files to your filterscript foder, you will have to create a folder inside scripfiles called
Vehicles, also, you need the Dini include, you can download it from
here.
You will need to change in the script the
SERVER_VEHICLES to your actual server vehicles, always adding +1, for example, if you've got 100 car in your server, you must put 101.
You may want to change the textdraw position too.
Pictures:
Link:
Solidfiles >
NEW VERSION, MORE ACCURATE! <
Special thanks:- To Hiddos, for helping me to make it more accurate.
Peace.
Re: Trip-o-Meter - Save vehicle KM! -
Flyfishes - 10.11.2010
Awesome script! Could you please tell us abit more?
Re: Trip-o-Meter - Save vehicle KM! -
The_Moddler - 10.11.2010
Quote:
Originally Posted by Flyfishes
Awesome script! Could you please tell us abit more?
|
I'm done, I accidentally pressed Submit instead of preview
Re: Trip-o-Meter - Save vehicle KM! -
kakalakamakapaka - 10.11.2010
thanks u soo much....
Re: Trip-o-Meter - Save vehicle KM! -
dark_clown - 10.11.2010
look's nice
im not trying it because i have my own but still
nice job
Re: Trip-o-Meter - Save vehicle KM! -
Hiddos - 10.11.2010
I'm wondering how accurate this is, looking at the way that meters get added. Anyways, this is something new and worth a try. I'll try it
Re: Trip-o-Meter - Save vehicle KM! -
The_Moddler - 10.11.2010
Quote:
Originally Posted by Hiddos
I'm wondering how accurate this is, looking at the way that meters get added. Anyways, this is something new and worth a try. I'll try it
|
I did try to make it accurate, the only way is to use floats, and is a pain in the ass, although I haven't really tryed.
I made a version wich adds +2 if your velocity is greater than 0.950, I think I might add it.
Re: Trip-o-Meter - Save vehicle KM! -
Hiddos - 10.11.2010
Quote:
Originally Posted by The_Moddler
I did try to make it accurate, the only way is to use floats, and is a pain in the ass, although I haven't really tryed.
I made a version wich adds +2 if your velocity is greater than 0.950, I think I might add it.
|
Well if I could try to do a suggestion, I'm sure you could find the function to retrieve the KM/h of a vehicle in a decent speed-o-meter FS, so you could try calling that function every ONE second, then divide that by 3.6 (The transfer rate from KM/h to m/s) and add it to a specific floating number. If you need some help with floats, I'd be glad to as they interest me a lot
Re: Trip-o-Meter - Save vehicle KM! -
The_Moddler - 10.11.2010
Quote:
Originally Posted by Hiddos
Well if I could try to do a suggestion, I'm sure you could find the function to retrieve the KM/h of a vehicle in a decent speed-o-meter FS, so you could try calling that function every ONE second, then divide that by 3.6 (The transfer rate from KM/h to m/s) and add it to a specific floating number. If you need some help with floats, I'd be glad to as they interest me a lot
|
Yeah, I just have one, I made this:
pawn Код:
if(GetVehicleSpeed(vehicleid) > 10)
{
Metros[vehicleid] += floatround(floatdiv(GetVehicleSpeed(vehicleid), 3.6));
}
But meters goes from 6 from 6 depending on the speed, which is nice.
I don't know if is that what you told me to do, becouse right now I'm going to change 3.6 to something bigger..
Thanks for help mate
EDIT:
Kaaboom! Just got it, now it's accurate
Thanks
Re: Trip-o-Meter - Save vehicle KM! -
wups - 10.11.2010
I would do like this.
Check every minute: KM is per Hour so we divide it on 60. So it would be km/min.
So,
pawn Код:
Metros[vehicleid] += floatround(GetVehicleSpeed(vehicleid)/60);
A better idea, would be to have it as a float, but show on screen as a integer.Then you can check every second, and add speed/ 3600.
Also, noone mentioned, that link doesn't work(haha ppl are only trolling arround
)