03.12.2013, 06:41
I've been having this y_ini(Writing/Loading) problem for a quite a while now.
I've tried re-naming the enum, changing it to "GetPlayerScore" etc.
The stuff writes(saves into the /Users/files), but it doesn't seem to load.
Well, I'm not sure which things i will need to give, so i will for now just post the Enums and LoadUser.
And here's the LoadUser.
As i mentioned, everything writes into the scriptfiles/users/name.blabla, but it doesn't seem to load.
The password, Money(Cash), Kills, Deaths, Muted work, but the other one's don't seem to work.
I've tried re-naming the enum, changing it to "GetPlayerScore" etc.
The stuff writes(saves into the /Users/files), but it doesn't seem to load.
Well, I'm not sure which things i will need to give, so i will for now just post the Enums and LoadUser.
pawn Код:
enum pInfo
{
pPass,
pCash,
pAdmin,
pScore,
pKills,
pDeaths,
pMuted,
pVIP,
pReward//christmas thing
}
pawn Код:
//OnPlayerConnect
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","Type your password below to login.","Login","Quit");
}
pawn Код:
//OnPlayerDisconnect
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,"Score",PlayerInfo[playerid][pScore]);//I've tried changing this to "GetPlayerScore(playerid));"
INI_WriteInt(File,"Muted",PlayerInfo[playerid][pMuted]);
INI_WriteInt(File,"VIP",PlayerInfo[playerid][pVIP]);
INI_WriteInt(File,"Reward",PlayerInfo[playerid][pReward]);//christmas stuff
INI_Close(File);
pawn Код:
forward LoadUser_data(playerid,name[],value[]);
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("Score",PlayerInfo[playerid][pScore]);
INI_Int("Muted",PlayerInfo[playerid][pMuted]);
INI_Int("VIP", PlayerInfo[playerid][pVIP]);
INI_Int("Reward",PlayerInfo[playerid][pReward]);//Christmas stuff
return 1;
}
The password, Money(Cash), Kills, Deaths, Muted work, but the other one's don't seem to work.