Dini is not loading
#1

pawn Код:
stock LoadShops()
{
    new file[50];
    for(new i = 0; i < MAX_SHOPS; i++)
    {
        format(file, sizeof(file), "Shops/%d.ini", i);
        if(fexist(file))
        {
            ShopInfo[i][Robbable] = 1;
            ShopInfo[i][EnterX] = dini_Int(file, "EnterPickX");
            ShopInfo[i][EnterY] = dini_Int(file, "EnterPickY");
            ShopInfo[i][PickZ] = dini_Float(file, "PickZ");
            ShopInfo[i][ExitPosX] = dini_Float(file, "ExitPosX");
            ShopInfo[i][ExitPosY] = dini_Float(file, "ExitPosY");
            ShopInfo[i][EnterPosX] = dini_Float(file, "EnterPosX");
            ShopInfo[i][EnterPosY] = dini_Float(file, "EnterPosY");
            ShopInfo[i][EnterPosZ] = dini_Float(file, "EnterPosZ");
            ShopInfo[i][ExitX] = dini_Float(file, "ExitX");
            ShopInfo[i][ExitY] = dini_Float(file, "ExitY");
            ShopInfo[i][ExitZ] = dini_Float(file, "ExitZ");
            ShopInfo[i][EnterFAngle] = dini_Float(file, "EnterFAngle");
            ShopInfo[i][ExitFAngle] = dini_Float(file, "ExitFAngle");
            ShopInfo[i][RobberyCheckX] = dini_Float(file, "RobberyCheckX");
            ShopInfo[i][RobberyCheckY] = dini_Float(file, "RobberyCheckY");
            ShopInfo[i][RobberyCheckZ] = dini_Float(file, "RobberyCheckZ");
            ShopInfo[i][Maxmoney] = dini_Int(file, "Maxmoney");
            ShopInfo[i][Minmoney] = dini_Int(file, "Minmoney");
            ShopInfo[i][Interior] = dini_Int(file, "Interior");
            ShopInfo[i][Mapiconid] = dini_Int(file, "Mapiconid");
            ShopInfo[i][RobberyValue] = dini_Int(file, "RobberyValue");
            strmid(ShopInfo[i][Name], dini_Get(file, "Name"), false, strlen(dini_Get(file, "Name")), MAX_SHOP_NAME);
            strmid(ShopInfo[i][sLocation], dini_Get(file, "Location"), false, strlen(dini_Get(file, "Location")), MAX_SHOP_NAME);
            ShopInfo[i][RCP] = CreateDynamicCP(ShopInfo[i][RobberyCheckX],ShopInfo[i][RobberyCheckY], ShopInfo[i][RobberyCheckZ], 2.5, i, ShopInfo[i][Interior], -1, 100.0);
            ShopInfo[i][Label] = Create3DTextLabel(ShopInfo[i][Name], COLOR_WHITE, ShopInfo[i][EnterX], ShopInfo[i][EnterY], ShopInfo[i][PickZ], 30.0, 0, 0);
            ShopInfo[i][Mapicon] = CreateDynamicMapIcon(ShopInfo[i][EnterX], ShopInfo[i][EnterY], ShopInfo[i][PickZ], ShopInfo[i][Mapiconid], COLOR_WHITE, 0, 0, -1, 100.0, MAPICON_LOCAL);
            ShopInfo[i][PickEnter] = CreateDynamicPickup(19197, 23 ,ShopInfo[i][EnterX], ShopInfo[i][EnterY], ShopInfo[i][PickZ],0,0,-1,100.0);
            ShopInfo[i][PickExit] = CreateDynamicPickup(19197, 23, ShopInfo[i][ExitX], ShopInfo[i][ExitY], ShopInfo[i][ExitZ], sid, ShopInfo[i][Interior], -1, 100.0);
            sid++;
        }
    }
    return 1;
}
With this code, Dini is not loading the things in the file.

pawn Код:
sid++
is executed. That means Dini is not working. Am I missing something? Someone please help me.

It's saving correctly, but not loading.
Reply
#2

dini_IntSet and not dini_int
look into this link wiki.sa-mp.com/wiki/Useful_Functions
it was the dini funcs there.
Reply
#3

Quote:
Originally Posted by caoraivoso3
Посмотреть сообщение
dini_IntSet and not dini_int
look into this link wiki.sa-mp.com/wiki/Useful_Functions
it was the dini funcs there.
What??

It's dini_Int not dini_IntSet because dini_IntSet is used to write and dini_Int is used to read.
Reply
#4

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
What??

It's dini_Int not dini_IntSet because dini_IntSet is used to write and dini_Int is used to read.
sorry. then the thing is actually saved to begin with? to load you need first to save, i don't use dini to save only dof/mysql but try to look into the save and see something.
Reply
#5

Quote:
Originally Posted by caoraivoso3
Посмотреть сообщение
sorry. then the thing is actually saved to begin with? to load you need first to save, i don't use dini to save only dof/mysql but try to look into the save and see something.
Look my post, it's saving correctly, not just loading.
Reply
#6

Fixed myself, thanks for trying to help me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)