Vehicles wont load at file
#1

On my OnGamemodeInit() i have this script:
pawn Код:
//Vehicles
    for(new i = 1; i <= MAX_VEHICLES; i++)
    {
        new file[128];
        format(file, sizeof(file), "vehicles/%s.ini", i);
        AddStaticVehicleEx(dini_Int(file,"Model"), dini_Float(file,"PosX"), dini_Float(file,"PosY"), dini_Float(file,"PosZ"), dini_Float(file,"Angle"), dini_Int(file,"Color1"), dini_Int(file,"Color2"), 0);
    }
It should load every vehicle at scriptfiles/vehicles/
Like scriptfiles/vehicles/1.ini etc..
But it dosnt load, What is my problem?

Sorry for My bad english
Reply
#2

If this doesn't work, the problem is in your saving/loading.

pawn Код:
for(new i = 0; i < MAX_VEHICLES; i++)
{
    new file[40];
    format(file, sizeof(file), "vehicles/%d.ini", i);
    if(!fexist(file)) continue;
    AddStaticVehicleEx(dini_Int(file,"Model"), dini_Float(file,"PosX"), dini_Float(file,"PosY"), dini_Float(file,"PosZ"), dini_Float(file,"Angle"), dini_Int(file,"Color1"), dini_Int(file,"Color2"), 0);
}
EDIT: Also, make sure this line is spelled correctly, and has the proper capital letters etc.
Make sure you have created the folder 'vehicles' in your scriptfiles directory.

Reason: You had %s instead of %d, i is not a string, it is an integer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)