ODOmeter needs to be in KM but its Meters
#1

So i got the ODO script:
pawn Код:
new string[128];
    if(IsPlayerInAnyVehicle(playerid))
    {
        if(GetPlayerVehicleSeat(playerid) == 0)
        {
            new vehid = GetPlayerVehicleID(playerid);
            vehicle_odometers[vehid] += GetPlayerDistanceFromPoint(playerid, old_veh_pos[vehid][0], old_veh_pos[vehid][1], old_veh_pos[vehid][2]);
            GetVehiclePos( vehid, old_veh_pos[vehid][0], old_veh_pos[vehid][1], old_veh_pos[vehid][2]);
            format(string, sizeof(string), "Your odo: %0.2f", vehicle_odometers[vehid]);
            SendClientMessage(playerid, COLOR_GREY, string);
        }
    }
But it updates for meters... Anyone knows how to make this for KM? :S
Reply
#2

divide the odometer by 1000. using a different format will fit better then, too:
pawn Код:
format(string, sizeof(string), "Odo (KM): %04.2f", vehicle_odometers[vehid]/1000.0);
Reply
#3

Ignore this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)