11.05.2013, 11:09
Simplified:
Basically foreach x || y traveled it puts a tick into a var and divides that by lets say 100, then adds that to the current mileage. Any thoughts would help
Just need a point in the right direction.
Thanks
Complex:
I am looking to create a mileage system that puts ticks of integers into a variable based on a X or Y moved divided by a given int. So if we define a float range of lets say 1000, it returns 1 mile on the odometer. foreach is not my strong point
Any help is appreciated.
I found this system:
But have no idea a good way to call this. A timer perhaps?
EDIT: Scratch that code, its for a speedometer.
Basically foreach x || y traveled it puts a tick into a var and divides that by lets say 100, then adds that to the current mileage. Any thoughts would help

Just need a point in the right direction.
Thanks

Complex:
I am looking to create a mileage system that puts ticks of integers into a variable based on a X or Y moved divided by a given int. So if we define a float range of lets say 1000, it returns 1 mile on the odometer. foreach is not my strong point

I found this system:
PHP код:
new Float:Milleage[MAX_VEHICLES];
new Float:ST[4], vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleVelocity(vehicleid,ST[0],ST[1],ST[2]);
ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 179.28625;
Milleage[vehicleid] += ST[3]/2000;
Credits to ball ^
EDIT: Scratch that code, its for a speedometer.
