SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 27/01/2012, 03:00 PM   #1
milanosie
High-roller
 
milanosie's Avatar
 
Join Date: Dec 2011
Location: Amsterdam, Netherlands
Posts: 1,662
Reputation: 379
Default Loading the next file.

I finally am nearly done with my dealership, now the question is.
Since I added locks it only loads one car at a restart. How do I make this more?

pawn Code:
forward LoadCars();
public LoadCars()
{
    for(new i = 1; i < MAX_VEHICLES; i++)
    {
    format(file4,sizeof(file4), "realityrp/vehicles/%d.ini", i);
    if(fexist(file4))
    {
        CarInfo[i][model] = dini_Int(file4, "model");
        CarInfo[i][owner] = dini_Int(file4, "owner");
        CarInfo[i][forsale] = dini_Int(file4, "forsale");
        CarInfo[i][vehx] = dini_Int(file4, "vehx");
        CarInfo[i][vehy] = dini_Int(file4, "vehy");
        CarInfo[i][vehz] = dini_Int(file4, "vehz");
        CarInfo[i][rot] = dini_Int(file4, "rot");
        CarInfo[i][vcol1] = dini_Int(file4, "vcol1");
        CarInfo[i][vcol2] = dini_Int(file4, "vcol2");
        new modv = dini_Int(file4, "model");
        new flx = dini_Int(file4, "vehx");
        new fly = dini_Int(file4, "vehy");
        new flz = dini_Int(file4, "vehz");
        new flr = dini_Int(file4, "rot");
        new fc1 = dini_Int(file4, "vcol1");
        new fc2 = dini_Int(file4, "vcol2");
        CarID = CreateVehicle(modv, flx, fly, flz, flr, fc1, fc2, 6000000);
        vehown[CarID] = CarInfo[i][owner];
        ispr[CarID] = 1;
        return 1;
        }
    }
    return 1;
}

So I want that it loads the files 1.ini 2.ini 3.ini etc.

Is this possible?
milanosie is offline   Reply With Quote
Old 27/01/2012, 04:20 PM   #2
milanosie
High-roller
 
milanosie's Avatar
 
Join Date: Dec 2011
Location: Amsterdam, Netherlands
Posts: 1,662
Reputation: 379
Default Re: Loading the next file.

anybody?
milanosie is offline   Reply With Quote
Old 27/01/2012, 04:54 PM   #3
AndreT
Gangsta
 
AndreT's Avatar
 
Join Date: Jul 2011
Posts: 966
Reputation: 414
Default Re: Loading the next file.

You have a return 1; in your loop. This stops processing all the code!
AndreT is offline   Reply With Quote
Old 27/01/2012, 05:23 PM   #4
milanosie
High-roller
 
milanosie's Avatar
 
Join Date: Dec 2011
Location: Amsterdam, Netherlands
Posts: 1,662
Reputation: 379
Default Re: Loading the next file.

thanks
milanosie 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
Loading Something From A File Tommy_Mandaz Help Archive 10 30/06/2011 04:07 PM
Re-loading a file? Skylar Paul Help Archive 1 29/05/2011 05:37 AM
Loading File Andrejs Help Archive 3 05/09/2010 08:26 PM
File Loading (Jeff) Help Archive 1 21/10/2009 01:58 PM
loading cars from file xCoder Help Archive 7 15/09/2009 01:28 AM


All times are GMT. The time now is 03:45 AM.


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