SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 09/12/2012, 12:56 PM   #1
tsonn1
Big Clucker
 
Join Date: Aug 2012
Posts: 195
Reputation: 0
Default Car dealership bug

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 Code:
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. ))
tsonn1 is offline   Reply With Quote
Old 09/12/2012, 04:12 PM   #2
tsonn1
Big Clucker
 
Join Date: Aug 2012
Posts: 195
Reputation: 0
Default Re: Car dealership bug

Or should I make a different DS system?
tsonn1 is offline   Reply With Quote
Old 09/12/2012, 06:03 PM   #3
nGen.SoNNy
Gangsta
 
nGen.SoNNy's Avatar
 
Join Date: Sep 2009
Location: Romania
Posts: 929
Reputation: 69
Default Re: Car dealership bug

You have to select just the ID from that car I see you have a loop here...so the script do what you write.
__________________
If i've helped you, please click
nGen.SoNNy is offline   Reply With Quote
Old 10/12/2012, 12:27 PM   #4
tsonn1
Big Clucker
 
Join Date: Aug 2012
Posts: 195
Reputation: 0
Default Re: Car dealership bug

How can I do it?
tsonn1 is offline   Reply With Quote
Old 10/12/2012, 05:20 PM   #5
tsonn1
Big Clucker
 
Join Date: Aug 2012
Posts: 195
Reputation: 0
Default Re: Car dealership bug

Anyone? How can I make it select only one car?
tsonn1 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dealership crimind Scripting Help 5 26/01/2012 01:09 PM
[HELP] - Help about car dealership SpaMaster Help Archive 8 02/08/2011 04:37 PM
Dealership Help Tommy_Mandaz Help Archive 1 27/03/2011 11:36 PM
Car dealership Anteino Help Archive 0 23/12/2010 12:28 AM


All times are GMT. The time now is 12:59 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.