SA-MP Forums Archive
dini problem - 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 problem (/showthread.php?tid=288410)



dini problem - knackworst - 07.10.2011

hi, I read a admin system tut with dini
but its freakin badly explained... there's no good tutorial on how to use dini for the first time... I do not get how you guys learned it...
anyways heres my code::
pawn Код:
if(pickupid == driverpickupspawn)
    {
        new Dstat[128];
        new name[MAX_PLAYER_NAME], string[500];
        GetPlayerName(playerid, name, sizeof(name));
        format(Dstat,sizeof(Dstat),"/spelers/%s.ini",name);
       
        if(!fexist(Dstat))
        {
            dini_Create(Dstat);
            dini_IntSet(Dstat,"Driver", 0);
           
            format(string, sizeof(string), "Joined this team already: %d times!",pInfo[playerid][pDrivJoins]);
            SendClientMessage(playerid, COLOR_YELLOW, string);
        }
        else
        {
            pInfo[playerid][pDrivJoins] = dini_Int(Dstat, "Driver");
            dini_IntSet(Dstat,"Driver", pInfo[playerid][pDrivJoins] + 1);
           
            format(string, sizeof(string), "Joined this team already: %d times!",pInfo[playerid][pDrivJoins]);
            SendClientMessage(playerid, COLOR_YELLOW, string);
        }
it should count the amount of times that u picked up the pickup but it does not work, I keep oin getting the message that I joined the tam 0 times even if ijoined it twice...
also in my scriptfiles folder no new folder gets created...


Re: dini problem - CyNiC - 07.10.2011

Just replace to:
pawn Код:
if(pickupid == driverpickupspawn)
    {
        new Dstat[128];
        new name[MAX_PLAYER_NAME], string[500];
        GetPlayerName(playerid, name, sizeof(name));
        format(Dstat,sizeof(Dstat),"/spelers/%s.ini",name);

        if(!fexist(Dstat))
        {
            dini_Create(Dstat);
            dini_IntSet(Dstat,"Driver", 0);

            format(string, sizeof(string), "Joined this team already: %d times!",pInfo[playerid][pDrivJoins]);
            SendClientMessage(playerid, COLOR_YELLOW, string);
        }
        else
        {
            pInfo[playerid][pDrivJoins] = dini_Int(Dstat, "Driver");
            dini_IntSet(Dstat,"Driver", pInfo[playerid][pDrivJoins]++);

            format(string, sizeof(string), "Joined this team already: %d times!",pInfo[playerid][pDrivJoins]);
            SendClientMessage(playerid, COLOR_YELLOW, string);
        }
Your system looks work fine.


Re: dini problem - knackworst - 07.10.2011

I see that u added ++
but what did u change so it will create the file in my scriptfiles folder?


Re: dini problem - CyNiC - 07.10.2011

Did you create the 'spelers' directory?


Re: dini problem - knackworst - 07.10.2011

uhm, no...
is that necessairy then?


Re: dini problem - CyNiC - 07.10.2011

Yes, inside of scriptfiles.


Re: dini problem - knackworst - 07.10.2011

ok thank you
btw do you know any link that EXPLAINS how to use dini, cos i'm so frustrated of all this people saying they explain dini but theres never ever ever a good tutorial or a full native list of functions wich comes with a file operator...
For noobs like me also Y_INI is very badly explained...


Re: dini problem - CyNiC - 07.10.2011

I don't know. Study simple and varied filterscripts/includes that uses dini and you'll understand how to use it.


Re: dini problem - knackworst - 07.10.2011

Yeh but theres like fexist and dini_exist and dini_int dini_getint
All so confusing...