Saving
#1

How can I save the skin they chose after registering?

and when they connect again, the skin they chose will load.
The enum:
pawn Код:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pWarnings,
    pDeaths,
    pScores,
    pDonator,
}
Forward:
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("Scores",PlayerInfo[playerid][pScores]);
    INI_Int("Donator",PlayerInfo[playerid][pDonator]);
    return 1;
}
OnPlayerDisconnect
pawn Код:
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,"Scores",PlayerInfo[playerid][pScores]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_WriteInt(File,"Donator",PlayerInfo[playerid][pDonator]);
    INI_Close(File);
OnDialogResponse:
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,"Kills",0);
         INI_WriteInt(File,"Deaths",0);
         INI_WriteInt(File,"Scores",0);
         INI_WriteInt(File,"Donator",0);

         INI_Close(File);

I'm learning about this codes.
Thanks.
Reply


Messages In This Thread
Saving - by StrangeLove - 21.07.2012, 23:56
Re: Saving - by Kindred - 22.07.2012, 00:00
Re: Saving - by StrangeLove - 22.07.2012, 00:02
Re: Saving - by L.Hudson - 22.07.2012, 00:02
Re: Saving - by Kindred - 22.07.2012, 00:07
Re: Saving - by StrangeLove - 22.07.2012, 00:10
Re: Saving - by L.Hudson - 22.07.2012, 00:10
Re: Saving - by Kindred - 22.07.2012, 00:10
Re: Saving - by StrangeLove - 22.07.2012, 00:12
Re: Saving - by Kindred - 22.07.2012, 00:14

Forum Jump:


Users browsing this thread: 1 Guest(s)