SA-MP Forums Archive
Debug Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Debug Help (/showthread.php?tid=620955)



Debug Help - rollinforq - 05.11.2016

Fixed.


Re: Debug Help - Sew_Sumi - 05.11.2016

[GetVehicleModel(vehicleid - 400)]


Re: Debug Help - Konstantinos - 05.11.2016

GetVehicleModel returns 0 when the vehicle does not exist. You can prevent it in GetVehicleName but shouldn't this function be called at all in the first place for invalid vehicles.

pawn Код:
GetVehicleName(vehicleid)
{
    new vstring[18], modelid = GetVehicleModel(vehicleid);
    if (modelid) strcat(vstring, vehicleNames[modelid - 400]);
    return vstring;
}