Number Plate - 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: Number Plate (
/showthread.php?tid=496505)
Number Plate -
FaZeRs - 22.02.2014
So my Vehicle Number plates are not working
I have this under OnVehicleSpawn and the same under LoadPlayerVehicles
PHP код:
if(!isnull(PlayerVehicleInfo[i][v][pvPlate])) {
SetVehicleNumberPlate(PlayerVehicleInfo[i][v][pvId], PlayerVehicleInfo[i][v][pvPlate]);
}
else
{
new string[128], randletter[2];
randletter[0] = lAlphabet[random(sizeof(lAlphabet))][0];
randletter[1] = lAlphabet[random(sizeof(lAlphabet))][0];
format(string, sizeof(string), "%s%s%d", randletter[0], randletter[1], vehicleid);
SetVehicleNumberPlate(vehicleid, string);
}
It sets Custom Plate if vehicle have and if vehicle number plate is 0 it's suposed to set random vehicle plate
Re: Number Plate -
Smileys - 22.02.2014
use SetVehicleToRespawn after setting the plate.
https://sampwiki.blast.hk/wiki/Function:SetVehicleToRespawn
"The vehicle must be respawned or restreamed for the changes to take effect."
from the wiki:
https://sampwiki.blast.hk/wiki/SetVehiclePlate
if you want the vehicle to go back to a specific position, just get it's X, Y, Z and angle coords from it BEFORE respawning it.
then after respawning it, set it back to those coords.
Re: Number Plate -
FaZeRs - 22.02.2014
I have Function in OnVehicle Spawn and i want to set all those default number plates like AL - Vehicle ID.
PHP код:
format(string, sizeof(string), "%s%s%d", randletter[0], randletter[1], vehicleid);