SA-MP Forums Archive
Y_INI "Parse File" Help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Y_INI "Parse File" Help (/showthread.php?tid=241631)



Y_INI "Parse File" Help - maramizo - 18.03.2011

So, I'm trying Y_INI knowing that it's the fastest, and I don't know how to use "Parse File" to open the file and load the strings/etc. I can only save it.
Thanks.


Re: Y_INI "Parse File" Help - Snipa - 18.03.2011

Here's an example:
pawn Код:
INI_ParseFile(file, "LoginAcc", false, true, playerid, true, false);
pawn Код:
forward LoginAcc(playerid, name[ ], value[ ]);
public LoginAcc(playerid, name[ ], value[ ])
{
    if(strcmp(name,"Password")) SetPVarString(playerid,"pPass",value);
   
    if(!strcmp(name, "Level", false) ) {
        PInfo[playerid][Level1] = strval(value);
    }
    if(!strcmp(name, "VIP", false) ) {
        PInfo[playerid][VIP] = strval(value);
    }
    if(!strcmp(name, "Deaths", false) ) {
        PInfo[playerid][Deaths1] = strval(value);
    }
    if(!strcmp(name, "Cash", false) ) {
        PInfo[playerid][Cash] = strval(value);
    }
    if(!strcmp(name, "Score", false) ) {
        PInfo[playerid][Score] = strval(value);
    }
    if(!strcmp(name, "Kills", false) ) {
        PInfo[playerid][Kills1] = strval(value);
    }
    if(!strcmp(name, "Deaths", false) ) {
        PInfo[playerid][Deaths1] = strval(value);
    }
    return 1;
}



Re: Y_INI "Parse File" Help - maramizo - 19.03.2011

Quote:
Originally Posted by Snipa
Посмотреть сообщение
Here's an example:
pawn Код:
INI_ParseFile(file, "LoginAcc", false, true, playerid, true, false);
pawn Код:
forward LoginAcc(playerid, name[ ], value[ ]);
public LoginAcc(playerid, name[ ], value[ ])
{
    if(strcmp(name,"Password")) SetPVarString(playerid,"pPass",value);
   
    if(!strcmp(name, "Level", false) ) {
        PInfo[playerid][Level1] = strval(value);
    }
    if(!strcmp(name, "VIP", false) ) {
        PInfo[playerid][VIP] = strval(value);
    }
    if(!strcmp(name, "Deaths", false) ) {
        PInfo[playerid][Deaths1] = strval(value);
    }
    if(!strcmp(name, "Cash", false) ) {
        PInfo[playerid][Cash] = strval(value);
    }
    if(!strcmp(name, "Score", false) ) {
        PInfo[playerid][Score] = strval(value);
    }
    if(!strcmp(name, "Kills", false) ) {
        PInfo[playerid][Kills1] = strval(value);
    }
    if(!strcmp(name, "Deaths", false) ) {
        PInfo[playerid][Deaths1] = strval(value);
    }
    return 1;
}
pawn Код:
if(strcmp(name,"Password")) SetPVarString(playerid,"pPass",value);
What's this?


Re: Y_INI "Parse File" Help - maramizo - 19.03.2011

BUMP


Re: Y_INI "Parse File" Help - maramizo - 19.03.2011

Sigh... Bump