Mileage?
#1

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:
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 
But have no idea a good way to call this. A timer perhaps?

EDIT: Scratch that code, its for a speedometer.
Reply


Messages In This Thread
Mileage? - by MassDivide - 11.05.2013, 11:09
Re: Mileage? - by MassDivide - 11.05.2013, 23:24
Re: Mileage? - by Knappen - 11.05.2013, 23:41
Re: Mileage? - by MassDivide - 12.05.2013, 00:51
Re: Mileage? - by Knappen - 12.05.2013, 01:07
Re: Mileage? - by MassDivide - 12.05.2013, 01:14
Re: Mileage? - by Knappen - 12.05.2013, 01:18
Re: Mileage? - by MassDivide - 12.05.2013, 01:22

Forum Jump:


Users browsing this thread: 3 Guest(s)