Y_INI is not working properly [No warnings]
#1

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:

PHP Code:
enum pInfo
{
    
pPass,
    
pCash,
    
pAdmin,
    
pKills,
    
pDeaths,
    
pWantedLevel,
    
pScore
}
new 
PlayerInfo[MAX_PLAYERS][pInfo]; 
OnPlayerDisconnect:

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); 
Load User_Data

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;

It does create all the lines in the PlayerName.ini file but the score & wantedlevel is not loading.

Thanks in advance
Reply
#2

pawn Code:
INI_Int("WantedLevel",PlayerInfo[playerid][pWantedLevel]);
    INI_Int("Score",PlayerInfo[playerid][pWantedLevel]);
Of course it will not.
You defining PlayerInfo - WantedLevel in both "WantedLevel" and "Score"
Reply
#3

Quote:
Originally Posted by Romel
View Post
pawn Code:
INI_Int("WantedLevel",PlayerInfo[playerid][pWantedLevel]);
    INI_Int("Score",PlayerInfo[playerid][pWantedLevel]);
Of course it will not.
You defining PlayerInfo - WantedLevel in both "WantedLevel" and "Score"
Lawl, nub mistake.

I fixed that typo but it stills not working, It doesn't load the score + WantedLevel.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)