Loading/Writing/saving a file problem
#1

Hi guys, so I started a new gamemode, but having problems with the loading for score and money etc..
So it saves the admin level for now only.. I don't really know why.
Also like, when I use /ban, it should write in the file: Ban = 1, but always shows Ban = 0, but when they try to connect it shows they're banned until I do the command /unban..

Anyway I need some help for saving/loading from these files, and maybe writing in them too.
Let me give you my loading stuff..
LoadUser_data:
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("Mute",PlayerInfo[playerid][pMute]);
    INI_Int("Warns",PlayerInfo[playerid][pWarns]);
    INI_Int("Score", PlayerInfo[playerid][pScore]);
    INI_Int("Ban",PlayerInfo[playerid][pBan]);
    return 1;
}
OnPlayerDisconnect:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    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,"Mute",PlayerInfo[playerid][pMute]);
    INI_WriteInt(File,"Warns",PlayerInfo[playerid][pWarns]);
    INI_WriteInt(File,"Score", GetPlayerScore(playerid));
    INI_WriteInt(File,"Ban",PlayerInfo[playerid][pBan]);
    INI_Close(File);
Now on the registration we got this:
pawn Код:
new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Mute",0);
                INI_WriteInt(File,"Warns",0);
                INI_WriteInt(File,"Score", 0);
                INI_WriteInt(File,"Ban",0);
                INI_Close(File);
Can anyone please help me with this so I can proceed with my script? Would be awesome
Reply


Messages In This Thread
Loading/Writing/saving a file problem - by JimmyCh - 20.08.2013, 21:03
Re: Loading/Writing/saving a file problem - by iAnonymous - 20.08.2013, 21:11
Re: Loading/Writing/saving a file problem - by JimmyCh - 20.08.2013, 21:14
Re: Loading/Writing/saving a file problem - by RALL0 - 20.08.2013, 21:20
Re: Loading/Writing/saving a file problem - by JimmyCh - 20.08.2013, 21:24
Re: Loading/Writing/saving a file problem - by RALL0 - 20.08.2013, 21:32
Re: Loading/Writing/saving a file problem - by JimmyCh - 20.08.2013, 21:34
Re: Loading/Writing/saving a file problem - by RALL0 - 20.08.2013, 21:38
Re: Loading/Writing/saving a file problem - by JimmyCh - 20.08.2013, 21:45
Re: Loading/Writing/saving a file problem - by Matnix - 20.08.2013, 22:00

Forum Jump:


Users browsing this thread: 1 Guest(s)