Nagyon egyszerû, a SetVehicleNumberPlateEx meghívásával azonnal frissül a rendszám a jármûvünkön, nem kell újraspawnolni, a funkció elvégez mindent - a jármû utasai megmaradnak, ahogyan a jármû HP-ja és pozíciója is visszaállításra kerül.
[pawn]stock SetVehicleNumberPlateEx(vehicleid, numplate[])
{
if (!GetVehicleModel(vehicleid)) return false;
if (strlen(numplate) > 32) numplate[31] = EOS;
new a_Players[MAX_PLAYERS] = {-1, ...}, iVirtualWorld,
Float:fVehX, Float:fVehY, Float:fVehZ, Float:fVehRot,
Float:fVehVelocityX, Float:fVehVelocityY, Float:fVehVelocityZ, Float:fVehHealth;
GetVehiclePos(vehicleid, fVehX, fVehY, fVehZ);
GetVehicleZAngle(vehicleid, fVehRot);
GetVehicleVelocity(vehicleid, fVehVelocityX, fVehVelocityY, fVehVelocityZ);
GetVehicleHealth(vehicleid, fVehHealth);
iVirtualWorld = GetVehicleVirtualWorld(vehicleid);
for (new i = 0; i != MAX_PLAYERS; i++)
{
if (!IsPlayerInVehicle(i, vehicleid)) continue;
a_Players = GetPlayerVehicleSeat(i);
RemovePlayerFromVehicle(i);
}
SetVehicleVirtualWorld(vehicleid, iVirtualWorld + 25_000);
SetVehicleNumberPlate(vehicleid, (numplate[0] == EOS) ? \"\\32\\0\" : numplate);
SetVehicleVirtualWorld(vehicleid, iVirtualWorld);
for (new i = 0; i != MAX_PLAYERS; i++)
if (a_Players != -1) PutPlayerInVehicle(i, vehicleid, a_Players);
SetVehiclePos(vehicleid, fVehX, fVehY, fVehZ);
SetVehicleZAngle(vehicleid, fVehRot);
SetVehicleVelocity(vehicleid, fVehVelocityX, fVehVelocityY, fVehVelocityZ);
SetVehicleHealth(vehicleid, fVehHealth);
return true;
}[/pawn]