Hello, when I type /v get 1-5 , it spawns my car, but it doesn't put the plate to the vehicle, or the vehicle sanction(if it has one)
I dont understand it, because it safes the plate, and the vehicle sanction to the cars.cfg, but it doesn't come when I spawn the car.
I hope you can help me
I dont understand it, because it safes the plate, and the vehicle sanction to the cars.cfg, but it doesn't come when I spawn the car.
I hope you can help me
Code:
if(!strcmp(x_job,"get",true))
{
x_job = strtok(cmdtext,idx);
if(!strlen(x_job))
{
SendClientMessage(playerid, 0xAFAFAFAA, ""COL_SZR"Usage:"COL_WHITE" /v get [1-5]");
return 1;
}
if(VehicleTime[playerid] > 0)
{
format(string, sizeof(string), "Player vehicle still updating, please try again in %d seconds.", VehicleTime[playerid]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
if(strcmp(x_job,"1",true) == 0)
{
if(PlayerInfo[playerid][pCarkey] == SCRIPT_CARS) {
SendClientMessage(playerid,COLOR_GREY,"you do not have a vehicle in slot 1.");
return 1;
}
new carid;
new key2 = PlayerInfo[playerid][pCarkey];
if(CarInfo[PlayerInfo[playerid][pCarkey]][cImpounded]==1) {
format(string, sizeof(string), "Your %s is impounded! Go to the Police Department to pay the fine!",CarInfo[pCarkey][cDescription]);
SendClientMessage(playerid, COLOR_GREY, string);
new rand = random(sizeof(ImpoundFloat));
carid=AddStaticVehicleEx(CarInfo[key2][cModel], ImpoundFloat[rand][0], ImpoundFloat[rand][1], ImpoundFloat[rand][2], ImpoundFloat[rand][3],CarInfo[key2][cColorOne],CarInfo[key2][cColorTwo],3600);
//carid=AddStaticVehicleEx(CarInfo[key2][cModel],1626.7706,-1545.2421,13.4616, 270.00,CarInfo[key2][cColorOne],CarInfo[key2][cColorTwo],3600);
VehSpawned[carid] = 1;
VehicleOwned[carid] = key2;
VehicleEngine[carid] = 0;
return 1;
}
if(CarInfo[PlayerInfo[playerid][pCarkey]][cOwnedCar] == 0)
{
PlayerInfo[playerid][pCarkey] = SCRIPT_CARS;
}
if(ForwardOwnCar(1,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You already have a vehicle spawned, you must park it before you can spawn another"); return 1; }
else if(ForwardOwnCar(2,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You already have a vehicle spawned, you must park it before you can spawn another"); return 1; }
else if(ForwardOwnCar(3,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You already have a vehicle spawned, you must park it before you can spawn another"); return 1; }
else if(ForwardOwnCar(4,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You already have a vehicle spawned, you must park it before you can spawn another"); return 1; }
else if(ForwardOwnCar(5,playerid)) { SendClientMessage(playerid,COLOR_GREY,"You already have a vehicle spawned, you must park it before you can spawn another"); return 1; }
else
{
carid = AddStaticVehicleEx(CarInfo[key2][cModel],CarInfo[key2][cLocationx],CarInfo[key2][cLocationy],CarInfo[key2][cLocationz]+1.0,CarInfo[key2][cAngle],CarInfo[key2][cColorOne],CarInfo[key2][cColorTwo],3600);
SetVehicleNumberPlate(carid, CarInfo[key2][cPlate]);
VehSpawned[carid] = 1;
VehicleEngine[carid] = 0;
format(string, sizeof(string), "vehicle 1 ( %s ) spawned", CarInfo[PlayerInfo[playerid][pCarkey]][cDescription]);
SendClientMessage(playerid, COLOR_GREY, string);
VehicleOwned[carid] = key2;
SetVehicleToRespawn(carid);
LoadMods(carid,key2);
if(CarInfo[PlayerInfo[playerid][pCarkey]][cPTicket]==1 && CarInfo[PlayerInfo[playerid][pCarkey]][cPTicketS]==0) {
VehicleSanctionStats[carid][Sanctioned] = true;
CarInfo[PlayerInfo[playerid][pCarkey]][cPTicketS] = 1;
format(string, sizeof(string), ""COL_BIZ"Vehicle Sanction\nPrice: $%d\nReason: %s",CarInfo[PlayerInfo[playerid][pCarkey]][cPTPrice], CarInfo[PlayerInfo[playerid][pCarkey]][cPTReason]);
VehicleSanctionStats[carid][sText3d] = Create3DTextLabel(string, COLOR_BIZ, 0.0, 0.0, 0.0, TD_DISTANCE, 0, 0);
Attach3DTextLabelToVehicle(VehicleSanctionStats[carid][sText3d], carid, 0.0, 0.0, 0.0);
}
VehicleTime[playerid] = 15;
}
return 1;
}