MDC wont find vehicle plates!
#3

I think this should do it:

pawn Код:
forward UpdateDashCam(playerid);
public UpdateDashCam(playerid)
{
    if(!IsPlayerInAnyVehicle(playerid)) return 0x1;
    if(IsACopCar(playerid))
    {
        new pcv = GetNearestVehicle(playerid, dcam_Distance);
        new pvid = GetPlayerVehicleID(playerid);
        new Float:vPos[3];
        GetVehiclePos(pvid, vPos[0], vPos[1], vPos[2]);
        new Float:distance = GetVehicleDistanceFromPoint(pcv, vPos[0], vPos[1], vPos[2]);
        new Float:speed = GetVehicleSpeed(pcv, 0);
        new string[40];
        if(floatround(distance) <= dcam_Distance - 5.0)
        {
            format(string, sizeof(string), "P %s~n~S %d kmph~n~D %d m", VehicleNumberPlate[pcv], floatround(speed), floatround(distance));
        }
        else format(string, sizeof(string), "P N/A~n~S N/A kmph~n~D N/A m");
        PlayerTextDrawSetString(playerid, pDashCam[playerid], string);
    }
    return 0x1;
}
The thing is you didn't use "i" at all, only in "VehicleNumberPlate[i]", but as far as I am concerned, the vehicle's ID the code is looking for is "pcv", so try it now.
Reply


Messages In This Thread
MDC wont find vehicle plates! - by OpticKiller - 26.06.2013, 05:18
Re: MDC wont find vehicle plates! - by OpticKiller - 26.06.2013, 12:48
Re: MDC wont find vehicle plates! - by Cjgogo - 26.06.2013, 12:59
Re: MDC wont find vehicle plates! - by OpticKiller - 26.06.2013, 13:11

Forum Jump:


Users browsing this thread: 1 Guest(s)