Slight issue with Y_INI. Working, but messed up in the ini file
#5

pawn Код:
public LoadCar()
{
    for(new idx = 1; idx < sizeof(CarInfo) ; idx++)
    {
        new carfile[64];
        format(carfile, sizeof(carfile),"LARP/Vehicles/%d.ini", idx);
        new INI:clfile = INI_Open(carfile);
        if(fexist(carfile))
        {
            CarInfo[idx][cModel] = INI_Int(clfile,"Model");
            CarInfo[idx][cLocationx] = INI_SetTag(clfile,"Location_X");
            CarInfo[idx][cLocationy] = INI_SetTag(clfile,"Location_Y");
            CarInfo[idx][cLocationz] = INI_SetTag(clfile,"Location_Z");
            CarInfo[idx][cAngle] = INI_SetTag(clfile,"Angle");
            CarInfo[idx][cColorOne] = INI_Int(clfile,"Color_1");
            CarInfo[idx][cColorTwo] = INI_Int(clfile,"Color_2");
            strmid(CarInfo[idx][cOwner], INI_String(clfile,"Owner"), 0, strlen(INI_String(clfile,"Owner")), 255);
            CarInfo[idx][cOwned] = INI_Int(clfile,"Owned");
            CarInfo[idx][cLock] = INI_Int(clfile,"Locked");
            CarInfo[idx][cPaintjob] = INI_Int(clfile,"Paintjob");
            CarInfo[idx][cVirWorld] = INI_Int(clfile,"VirtualWorld");
            CarInfo[idx][cComponent0] = INI_Int(clfile,"Component0");
            CarInfo[idx][cComponent1] = INI_Int(clfile,"Component1");
            CarInfo[idx][cComponent2] = INI_Int(clfile,"Component2");
            CarInfo[idx][cComponent3] = INI_Int(clfile,"Component3");
            CarInfo[idx][cComponent4] = INI_Int(clfile,"Component4");
            CarInfo[idx][cComponent5] = INI_Int(clfile,"Component5");
            CarInfo[idx][cComponent6] = INI_Int(clfile,"Component6");
            CarInfo[idx][cComponent7] = INI_Int(clfile,"Component7");
            CarInfo[idx][cComponent8] = INI_Int(clfile,"Component8");
            CarInfo[idx][cComponent9] = INI_Int(clfile,"Component9");
            CarInfo[idx][cComponent10] = INI_Int(clfile,"Component10");
            CarInfo[idx][cComponent11] = INI_Int(clfile,"Component11");
            CarInfo[idx][cComponent12] = INI_Int(clfile,"Component12");
            CarInfo[idx][cComponent13] = INI_Int(clfile,"Component13");
            CarInfo[idx][cCode] = INI_Int(clfile,"SecurityCode");
            INI_Close(clfile); // Closes the file
        }
    }
    print("[SCRIPT]: Loaded Cars On New System! [Y_INI!]");
    return 1;
}
Pawno Crashes, any idea what I did wrong? Using Y_INI.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)