Vehicle System
#1

Hello all,

I would like to change my existing vehicle system.
I would like to calculate and store the number of miles traveled by the vehicle. As in real life so they can say: At 20 000 km, it is necessary to change the oil ... etc..

I did this calcul :

Код:
new Float:Dist;
Dist = floatsqroot(floatpower(floatabs(floatsub(PosX[i],x)),2)+floatpower(floatabs(floatsub(PosY[i],y)),2)+floatpower(floatabs(floatsub(PosZ[i],z)),2));
		distVehicle[i] = floatround(Dist,floatround_round);
		
		CarInfo[vehicleid][cMetre] = distVehicle[i];

if(CarInfo[vehicleid][cMetre] == 1000)
{
CarInfo[vehicleid][cKm] += 1;
}
I wonder if I'm on track or not.

Thank you for your help and sorry for my bad English..
Reply


Messages In This Thread
Vehicle System - by DexX39 - 30.04.2012, 21:07
Re: Vehicle System - by Yuryfury - 01.05.2012, 01:09

Forum Jump:


Users browsing this thread: 1 Guest(s)