Vehicle Plate Problem
#1

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
Reply
#2

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

Quote:

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

Reply
#3

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;
}
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)