Dealership car is not creating
#1

PHP код:
                new rand random(sizeof(randomDS));
                if(
PlayerVehicleSlot[playerid][9] == -1){
                    if(
DealerShipInfo[Player[playerid][CarCurrent]][1] != 0){
                        if(
Player[playerid][Money] >= DealerShipInfo[Player[playerid][CarCurrent]][1]){
                            new 
VehPlate[255];
                            
format(VehPlate255"%s"GetFreeVehiclePlate());
                            
Player[playerid][DSCar] = CreateVehicle(DealerShipInfo[Player[playerid][CarCurrent]][1],randomDS[rand][0], randomDS[rand][1], randomDS[rand][2], randomDS[rand][3],Player[playerid][TuneColorSelected1],Player[playerid][TuneColorSelected2],-1);
                            
mysql_queryM("INSERT INTO `OwnedVehicles` (`vModelID`,`VehicleOwner`, `VehiclePlate`, `vColor1`, `vColor2`) VALUES (%d, '%s', '%s', %d, %d)",DealerShipInfo[Player[playerid][CarCurrent]][0],GetName(playerid),VehPlate,Player[playerid][TuneColorSelected1],Player[playerid][TuneColorSelected2]);
                            
TakePlayerCash(playeridDealerShipInfo[Player[playerid][CarCurrent]][1]);
                            
SavedOwnedVehicles +=1;
                            
mysql_queryS("UPDATE `ServerData` SET `SavedOwnedVehicles` = %d WHERE ID = 1"SavedOwnedVehicles);
                            
SCM(playeridYELLOW"Info: You bought a car with Money!");
                        }else{
SCM(playeridRED"You do not have enough money for this vehicle!");}
                    }else{
SCM(playeridRED"> This car is only buyable with coins!");}
                }else{
SCM(playeridRED"> You already own 10 cars!");}
                
DestroyVehicle(Player[playerid][DSCar]);
                
Player[playerid][DSCar] = -1;
                
TextDrawHideForPlayer(playeridText:DSBG);
                
TextDrawHideForPlayer(playeridText:DSCI);
                
TextDrawHideForPlayer(playeridText:DSVName[playerid]);
                
TextDrawHideForPlayer(playeridText:DSVPM[playerid]);
                
TextDrawHideForPlayer(playeridText:DSVPC[playerid]);
                
Player[playerid][CarSelected] = 0;
                
Player[playerid][CarCurrent] = 0;
                
Player[playerid][TuneColorCurrent] = 0;
                
Player[playerid][TuneColorSelected1] = 0;
                
Player[playerid][TuneColorSelected2] = 0;
                
Player[playerid][TuneColorChange] = 0;
                
SetCameraBehindPlayer(playerid);
                
TogglePlayerControllable(playeridtrue);
                
HideMenuForPlayer(DSBuyplayerid);
                
DSBeingUsed 0;
                
AssignOwnedVehicles(playerid); 
The car won't be spawned but he will be saved...
Reply
#2

someonee
Reply
#3

bump.....
Reply
#4

Hello!

You destroy this vehicle after you create it.
PHP код:
DestroyVehicle(Player[playerid][DSCar
Delete this row, does it work then?
Reply
#5

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hello!

You destroy this vehicle after you create it.
PHP код:
DestroyVehicle(Player[playerid][DSCar
Delete this row, does it work then?
Thats for the show room, So it need to stay
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)