22.12.2012, 23:41
Hello lads!
I'm learing how to use Y_INI but I couldn't make it work (It loads the password,playerDeaths,Cash,Admin,PlayerKills,Money )
Not working:
*WantedLevel
*Score
Enum:
OnPlayerDisconnect:
Load User_Data
It does create all the lines in the PlayerName.ini file but the score & wantedlevel is not loading.
Thanks in advance
I'm learing how to use Y_INI but I couldn't make it work (It loads the password,playerDeaths,Cash,Admin,PlayerKills,Money )
Not working:
*WantedLevel
*Score
Enum:
PHP Code:
enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths,
pWantedLevel,
pScore
}
new PlayerInfo[MAX_PLAYERS][pInfo];
PHP Code:
///Y_INI
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File,"WantedLevel",SavedWantedLevel[playerid]);
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
INI_Close(File);
PHP Code:
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("Kills",PlayerInfo[playerid][pKills]);
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
INI_Int("WantedLevel",PlayerInfo[playerid][pWantedLevel]);
INI_Int("Score",PlayerInfo[playerid][pWantedLevel]);
return 1;
}
Thanks in advance