Y_INI Problem.
#1

Hello! I have a big problem with a Y_INI function.

Y_INI will not read a file of my vehicles system:


enum

pawn Код:
enum vInfo
{
    vId,
    vModel,
    Float:vPosX,
    Float:vPosY,
    Float:vPosZ,
    Float:vAngleX,
    vColor1,
    vColor2,
    Proprio[250],
    owend,
    acheter,
    vLock,
    vFaction,
    vJob,
    vCoffre,
    vArme1,
    vArme2,
    vArme3,
    vArme4,
    vMuni1,
    vMuni2,
    vMuni3,
    vMuni4,
    vEssence,
    vComponent0,
    vComponent1,
    vComponent2,
    vComponent3,
    vComponent4,
    vComponent5,
    vComponent6,
    vComponent7,
    vComponent8,
    vComponent9,
    vComponent10,
    vComponent11,
    vComponent12,
    vComponent13,
    vPaintJob,
    vPrixVente,
    vType
}
new VehicleInfo[MAX_VEHICLES][vInfo];
Function for load vehicles:

pawn Код:
for(new v = 0; v < MAX_VEHICLES; v++)
    {
        INI_ParseFile(VehiclePath(v), "LoadVehicle_%s", .bExtra = true, .extra = v);
        if(fexist(VehiclePath(v)))
        {
            AddStaticVehicleEx(VehicleInfo[v][vModel],VehicleInfo[v][vPosX],VehicleInfo[v][vPosY],VehicleInfo[v][vPosZ],VehicleInfo[v][vAngleX],VehicleInfo[v][vColor1],VehicleInfo[v][vColor2], -1);
            new GetModel = GetVehicleModel(v);
            new engine, lights, alarm, doors, bonnet, boot, objective;

            GetVehicleParamsEx(v, engine, lights, alarm, doors, bonnet, boot, objective);
            IsHSVehicle[v] = 0;
            if(VehicleInfo[v][vCoffre] == 1)
            {
                boot = 1;
            } else {
                boot = 0;
            }
            SetVehicleParamsEx(v, 0, lights, alarm, VehicleInfo[v][vLock], bonnet, boot, objective);
            Engines[v] = 0;
            if(GetModel == 509 || GetModel == 481 || GetModel == 510)
            {
                Engines[v] = 1;
                SetVehicleParamsEx(v, true, lights, alarm, doors, bonnet, boot, objective);
            }
        }
    }


pawn Код:
forward LoadVehicle_data(vehicleid,name[],value[]);
public LoadVehicle_data(vehicleid,name[],value[])
{
    print("Chargement..");
    INI_Int("ID",VehicleInfo[vehicleid][vId]);
    INI_Int("Model",VehicleInfo[vehicleid][vModel]);
    INI_Float("PosX",VehicleInfo[vehicleid][vPosX]);
    INI_Float("PosY",VehicleInfo[vehicleid][vPosY]);
    INI_Float("PosZ",VehicleInfo[vehicleid][vPosZ]);
    INI_Float("AngleX",VehicleInfo[vehicleid][vAngleX]);
    INI_Int("Color1", VehicleInfo[vehicleid][vColor1]);
    INI_Int("Color2", VehicleInfo[vehicleid][vColor2]);
    INI_String("Proprio", VehicleInfo[vehicleid][Proprio], 250);
    INI_Int("Owend", VehicleInfo[vehicleid][owend]);
    INI_Int("Lock", VehicleInfo[vehicleid][vLock]);
    INI_Int("Faction", VehicleInfo[vehicleid][vFaction]);
    INI_Int("Job", VehicleInfo[vehicleid][vJob]);
    INI_Int("Coffre", VehicleInfo[vehicleid][vCoffre]);
    INI_Int("Arme1", VehicleInfo[vehicleid][vArme1]);
    INI_Int("Arme2", VehicleInfo[vehicleid][vArme2]);
    INI_Int("Arme3", VehicleInfo[vehicleid][vArme3]);
    INI_Int("Arme4", VehicleInfo[vehicleid][vArme4]);
    INI_Int("Muni1", VehicleInfo[vehicleid][vMuni1]);
    INI_Int("Muni2", VehicleInfo[vehicleid][vMuni2]);
    INI_Int("Muni3", VehicleInfo[vehicleid][vMuni3]);
    INI_Int("Muni4", VehicleInfo[vehicleid][vMuni4]);
    INI_Int("Essence", VehicleInfo[vehicleid][vEssence]);
    INI_Int("Component0",VehicleInfo[vehicleid][vComponent0]);
    INI_Int("Component1",VehicleInfo[vehicleid][vComponent1]);
    INI_Int("Component2",VehicleInfo[vehicleid][vComponent2]);
    INI_Int("Component3",VehicleInfo[vehicleid][vComponent3]);
    INI_Int("Component4",VehicleInfo[vehicleid][vComponent4]);
    INI_Int("Component5",VehicleInfo[vehicleid][vComponent5]);
    INI_Int("Component6",VehicleInfo[vehicleid][vComponent6]);
    INI_Int("Component7",VehicleInfo[vehicleid][vComponent7]);
    INI_Int("Component8",VehicleInfo[vehicleid][vComponent8]);
    INI_Int("Component9",VehicleInfo[vehicleid][vComponent9]);
    INI_Int("Component10",VehicleInfo[vehicleid][vComponent10]);
    INI_Int("Component11",VehicleInfo[vehicleid][vComponent11]);
    INI_Int("Component12",VehicleInfo[vehicleid][vComponent12]);
    INI_Int("Component13",VehicleInfo[vehicleid][vComponent13]);
    INI_Int("PaintJob", VehicleInfo[vehicleid][vPaintJob]);
    INI_Int("PrixVente", VehicleInfo[vehicleid][vPrixVente]);
    INI_Int("Type", VehicleInfo[vehicleid][vType]);
    return 1;
}

pawn Код:
stock VehiclePath(vehicleid)
{
    new string[128];
    format(string,sizeof(string),"Vehicule/%d.ini",vehicleid);

    return string;

}
Create vehicle not have problem.


If you resolve my big problem, i give +REPs!

Thanks for your responses!


(If you want more script, no problem.)
Reply
#2

Sorry, i not have added file
Reply
#3

My script create files wiht /createcar, file created, on /rcon gmx, INI Can't load My files
Reply
#4

What post ?
Reply
#5

I Clear all file, and not Debbuging..
Reply
#6

the problem would be in the directory where you save your .ini..possibly non existing file/folder

pawn Код:
stock VehiclePath(vehicleid)
{
    new string[128];
    format(string,sizeof(string),"Vehicule/%d.ini",vehicleid); //??????????????? ? ? ? ?

    return string;

}
Reply
#7

Folder exist
Reply
#8

What do you mean there's no problem creating the car if you cannot load the file? Are you sure you are creating the file properly?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)