Car dealership bug
#1

Hello, everyone!
I've got a problem with my car dealership system.
The ownable cars are in my MySQL DB. I've made 25 cars and put them to a far away location.
When someone goes to car DS and buys a car, I want the car to spawn outside to the DS parking lot and the model changed to the model, the buyer wants. It all works, but there's one problem.
The GM takes all the cars, sets their models to the right ones and spawns them all to the DS parking lot. I want it to spawn only one car there, but it just spawns all the cars.

The code:
pawn Код:
public BuyASultan(playerid)
{
    new alldacars = AllTheCars();
    for(new i = 1; i < alldacars; i++)
    {
        if(CarInfo[i][cInDaShopForSale] == 1)
        {
            DestroyVehicle(i);
            new NewModel = AddStaticVehicleEx(560,-785.3877,2753.9294,45.2800,235.9695,1,1, 999999999999999999);
        }
    }
}

((Translated from Estonian. ))
Reply
#2

Or should I make a different DS system?
Reply
#3

You have to select just the ID from that car I see you have a loop here...so the script do what you write.
Reply
#4

How can I do it?
Reply
#5

Anyone? How can I make it select only one car?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)