Skip to content

Commit

Permalink
Fixed GetVehicleNumberPlate returned NULL as plate
Browse files Browse the repository at this point in the history
  • Loading branch information
kurta999 committed Nov 22, 2016
1 parent 7bf51b4 commit d6817d7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Scripting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2815,7 +2815,16 @@ AMX_DECLARE_NATIVE(Natives::GetVehicleNumberPlate)
if(!pNetGame->pVehiclePool->pVehicle[vehicleid])
return 0;

return set_amxstring(amx, params[2], pNetGame->pVehiclePool->pVehicle[vehicleid]->szNumberplate, params[3]);
char* szPlate = NULL;
if (pNetGame->pVehiclePool->pVehicle[vehicleid]->szNumberplate[0])
{
szPlate = &pNetGame->pVehiclePool->pVehicle[vehicleid]->szNumberplate[0];
}
else
{
szPlate = "XYZSR998";
}
return set_amxstring(amx, params[2], szPlate, params[3]);
}

// native SetVehicleRespawnDelay(vehicleid, delay);
Expand Down

0 comments on commit d6817d7

Please sign in to comment.