30.04.2012, 21:07
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 :
I wonder if I'm on track or not.
Thank you for your help and sorry for my bad English..
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;
}
Thank you for your help and sorry for my bad English..

