ChangeVehiclePaintjob
#1

When I write the command / v park the car change paint job :/
Code for ”/v park”:
PHP код:
            else if(strcmp(x_nr,"park",true) == 0)
            {
                new 
Float:x,Float:y,Float:z;
                new 
Float:a;
                new 
carid1;
                new 
getcarid1;
                if(
GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid1 PlayerInfo[playerid][pPcarkey]; }
                else { return 
1; }
                
getcarid1 GetPlayerVehicleID(playerid);
                
GetVehiclePos(carid1xyz);
                
//GetPlayerFacingAngle(playerid, a);
                
GetVehicleZAngle(carid1a);
                if(
IsPlayerInVehicle(playerid,carid1) && CarInfo[carid1][cOwned] == 1)
                {
                    if(
PlayerToPoint(185.0,playerid,1718.1554,-1846.4375,13.2976))
                    {
                        
SCM(playeridCOLOR_WHITE"Este interzis parcarea masinilor in aceasta zona(Spawn Los Santos) !");
                        return 
1;
                    }
                       if(
PlayerInfo[playerid][pPcarkey] == 999)
                    {
                        
SCM(playeridCOLOR_GREY"You don't own a car.");
                        return 
1;
                    }
                    if(
getcarid1 == carid1)
                    {
                        new 
Float:health;
                        new 
veh;
                        
veh GetPlayerVehicleID(playerid);
                        
GetVehicleHealth(vehhealth);
                          if(
health 900) return SendClientMessage(playerid,COLOR_GREY,"Nu iti poti parca masina daca are mai putin de 900 HP(health).");
                        
CarInfo[carid1][cLocationx] = x;
                        
CarInfo[carid1][cLocationy] = y;
                        
CarInfo[carid1][cLocationz] = z;
                        
CarInfo[carid1][cAngle] = a;
                        
format(stringsizeof(string), "~n~ You have parked your vehicle in this location. ~n~");
                        
GameTextForPlayer(playerid"You have parked your vehicle in this position. It will respawn here."100003);
                        
OnVehUpdate();
                        
OnPlayerDateUpdate(playerid);
                        
DestroyVehicle(carid1);
                        
//CarInfo[carid1][cColorOne] =
                        
ownedcar[carid1] = CreateVehicle(CarInfo[carid1][cModel],CarInfo[carid1][cLocationx],CarInfo[carid1][cLocationy],CarInfo[carid1][cLocationz],CarInfo[carid1][cAngle],CarInfo[carid1][cColorOne],CarInfo[carid1][cColorTwo],60000);
                        
SetVehicleNumberPlate(getcarid1,CarInfo[carid1][cLicense]);
                        if(
CarInfo[carid1][cPaintjob] != 255)
                        {
                            
ChangeVehiclePaintjob(carid1CarInfo[carid1][cPaintjob]);
                        }
                        
SetVehicleVirtualWorld(carid1CarInfo[carid1][cVirWorld]);
                        
SetVehicleModifications(carid1);
                        
PutPlayerInVehicle(playeridcarid10);
                        
TogglePlayerControllable(playerid1);
                        return 
1;
                       }
                }
            } 
Reply
#2

Try to check if script is saving and loading right color, those lines might cause problem:

pawn Код:
if(CarInfo[carid1][cPaintjob] != 255)
                        {
                            ChangeVehiclePaintjob(carid1, CarInfo[carid1][cPaintjob]);
                        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)