SA-MP Forums Archive
Vehicle Plate Problem - 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: Vehicle Plate Problem (/showthread.php?tid=578429)



Vehicle Plate Problem - McGuiness - 19.06.2015

Got a small problem with my plate system, it saves the players plate but when it comes to spawning in the vehicle the plate doesn't show up, heres a code of the system:

pawn Код:
if(PlayerInfo[playerid][pVehicle1] != 0)
    {
        new engine,lights,alarm,doors,bonnet,boot,objective;
        new model1 = PlayerInfo[playerid][pVehicle1Model];
        new Float:car1x = PlayerInfo[playerid][pVehicle1X];
        new Float:car1y = PlayerInfo[playerid][pVehicle1Y];
        new Float:car1z = PlayerInfo[playerid][pVehicle1Z];
        new Float:car1c = PlayerInfo[playerid][pVehicle1C];
        new car1color1 = PlayerInfo[playerid][pVehicle1Color1];
        new car1color2 = PlayerInfo[playerid][pVehicle1Color2];
        new car1lock = PlayerInfo[playerid][pVehicle1Lock];
        personalcar1[playerid] = CreateVehicle(model1, car1x, car1y, car1z, car1c, car1color1, car1color2, 999999);
        SetVehicleNumberPlate(personalcar1[playerid], PlayerInfo[playerid][pVehicle1Plate]);
        if(car1lock != 0)
        {
            GetVehicleParamsEx(personalcar1[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(personalcar1[playerid], engine, lights, alarm, 1, bonnet, boot, objective);
        }
    }
NOTE: It sets the plate to the default which is the XYZ thing


Re: Vehicle Plate Problem - Vince - 19.06.2015

https://sampwiki.blast.hk/wiki/SetVehicleNumberPlate

Quote:

The vehicle must be re-spawned or re-streamed for the changes to take effect.




Re: Vehicle Plate Problem - Abagail - 19.06.2015

Do you respawn the vehicle after setting the plate? You need to respawn it for the plate to actually change, i.e using the SetVehicleToRespawn function after setting the plate. Ex of it inside of a wrapper function:

pawn Код:
stock SetVehicleNumberPlateEx(vehicleid, plate[])
{
      new return;
      return = SetVehicleNumberPlate(vehicleid, plate);
      SetVehicleToRespawn(vehicleid);
      return return;
}



Re: Vehicle Plate Problem - McGuiness - 19.06.2015

I have done it so it respawn's but the problem is that it still doesn't work :/