20.08.2013, 21:03
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:
OnPlayerDisconnect:
Now on the registration we got this:
Can anyone please help me with this so I can proceed with my script? Would be awesome
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;
}
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);
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);