SA-MP Forums Archive
Dini is not loading - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dini is not loading (/showthread.php?tid=562729)



Dini is not loading - ATGOggy - 11.02.2015

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.


Re: Dini is not loading - caoraivoso3 - 11.02.2015

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


Re: Dini is not loading - ATGOggy - 11.02.2015

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.


Re: Dini is not loading - caoraivoso3 - 11.02.2015

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.


Re: Dini is not loading - ATGOggy - 11.02.2015

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.


Re: Dini is not loading - ATGOggy - 11.02.2015

Fixed myself, thanks for trying to help me