Number Plate
#1

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(stringsizeof(string), "%s%s%d"randletter[0], randletter[1], vehicleid);
                    
SetVehicleNumberPlate(vehicleidstring);
                } 
It sets Custom Plate if vehicle have and if vehicle number plate is 0 it's suposed to set random vehicle plate
Reply
#2

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.
Reply
#3

I have Function in OnVehicle Spawn and i want to set all those default number plates like AL - Vehicle ID.
PHP код:
  format(stringsizeof(string), "%s%s%d"randletter[0], randletter[1], vehicleid); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)