SA-MP Forums Archive
Y_Ini Save GetPVarInt And Load SetPVarInt - 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: Y_Ini Save GetPVarInt And Load SetPVarInt (/showthread.php?tid=340837)



Y_Ini Save GetPVarInt And Load SetPVarInt - Admigo - 08.05.2012

Heey all,

I am using Y_Ini for my account system.
And i want to know how you can Save GetPVarInt And Load SetPVarInt?
Please help me. I need this.

Thanks Admigo


Re: Y_Ini Save GetPVarInt And Load SetPVarInt - Ballu Miaa - 08.05.2012

Why dont you add a integer variable in your enumeration of the array defined for your PlayerInfo? You will be able to save it for every player in their respective ini file. Make it the same way you have made Player's kills/deaths/etc.


Re: Y_Ini Save GetPVarInt And Load SetPVarInt - Admigo - 08.05.2012

Its saving but its not loading.


pawn Код:
//load user
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Logged",PlayerInfo[playerid][pLogged]);
    INI_Int("Class",PlayerInfo[playerid][pClass]);
    INI_Int("Money",PlayerInfo[playerid][pCash]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    return 1;
}

//dialog login
new string[256];
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
PlayerInfo[playerid][pClass]=PlayerInfo[playerid][pClass];
PlayerInfo[playerid][pLogged]=1;

//onplayerreqclass
if(PlayerInfo[playerid][pClass]==1)
    {
        Class_Goto(playerid, 0);
    }