Saving
#4

pawn Код:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pWarnings,
    pDeaths,
    pScores,
    pDonator,
    pSkin
}

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]);
    INI_Int("Skin",PlayerInfo[playerid][pSkin]);
    return 1;
}

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_WriteInt(File,"Skin",PlayerInfo[playerid][pSkin]);
    PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
    INI_Close(File);

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_WriteInt(File,"Skin",[here add the skinid that you want the registered user to have]);

         INI_Close(File);
Also add in

pawn Код:
public OnPlayerSpawn(playerid);
pawn Код:
public OnPlayerSpawn(playerid);
{
     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
     return 1;
}
EDIT: too late -.-
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)