Registration question
#8

Quote:
Originally Posted by Mento
Посмотреть сообщение
When I register it doesn't save the things, only creates the playerfile, but it's empty inside, why?

pawn Код:
new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Money",PlayerInfo[playerid][pMoney] = 50);
                INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdminLevel] = 0);
                INI_WriteInt(File,"Skin",PlayerInfo[playerid][pSkin] = 0);
                INI_Close(File);
pawn Код:
stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}
Pretty sure your doing it wrong cause the player will have no variables if he is registering, i have something like this in the making for my stunt server
pawn Код:
INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"Score",0);
cause then it just writes blank stats in the file then when the player disconnects it saves what stats he gained after he registered
this is then how i save on disconnect
[pawn]
stock SavePinfo(playerid)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
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]);
INI_Close(File);
}
Reply


Messages In This Thread
Registration question - by Mento - 03.05.2012, 03:25
Re: Registration question - by NewerthRoleplay - 03.05.2012, 06:51
Re: Registration question - by Mento - 03.05.2012, 18:37
Re: Registration question - by NewerthRoleplay - 04.05.2012, 06:26
Re: Registration question - by Mento - 04.05.2012, 10:23
Re: Registration question - by NewerthRoleplay - 05.05.2012, 17:29
Re: Registration question - by Mento - 05.05.2012, 18:48
Re: Registration question - by nickdodd25 - 05.05.2012, 21:14
Re: Registration question - by Mento - 06.05.2012, 16:00

Forum Jump:


Users browsing this thread: 1 Guest(s)