22.10.2014, 07:46
(
Last edited by Edw; 26/10/2014 at 05:37 PM.
)
Fixed.
enum PlayerData
{
pPass,
pLevel,
pMoney,
pAdmin,
pHelper,
pMember,
pLeader,
pSex,
pAge,
pEmail,
pSkin,
pLanguage
};
new PInfo[MAX_PLAYERS][PlayerData];
public OnPlayerDisconnect(playerid, reason)
{
// ===== Login and Register =====
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"pLevel",PlayerInfo[playerid][pLevel]);
INI_WriteInt(File,"pMoney",GetPlayerMoney(playerid));
INI_WriteInt(File,"pAdmin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"pHelper",PlayerInfo[playerid][pHelper]);
INI_WriteInt(File,"pMember",PlayerInfo[playerid][pMember]);
INI_WriteInt(File,"pLeader",PlayerInfo[playerid][pLeader]);
INI_WriteInt(File,"pSex",PlayerInfo[playerid][pSex]);
INI_WriteInt(File,"pAge",PlayerInfo[playerid][pAge]);
INI_WriteInt(File,"pEmail",PlayerInfo[playerid][pEmail]);
INI_WriteInt(File,"pSkin",PlayerInfo[playerid][pSkin]);
INI_WriteInt(File,"pLanguage",PlayerInfo[playerid][pLanguage]);
INI_Close(File);
//
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"pPass",udb_hash(inputtext));
INI_WriteInt(File,"pLevel",0);
INI_WriteInt(File,"pMoney",0);
INI_WriteInt(File,"pAdmin",0);
INI_WriteInt(File,"pHelper",0);
INI_WriteInt(File,"pMember",0);
INI_WriteInt(File,"pLeader",0);
INI_WriteInt(File,"pSex",0);
INI_WriteInt(File,"pAge",0);
INI_WriteInt(File,"pEmail",0);
INI_WriteInt(File,"pSkin",0);
INI_WriteInt(File,"pLanguage",0);
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("pPass",PlayerInfo[playerid][pPass]);
INI_Int("pLevel",PlayerInfo[playerid][pLevel]);
INI_Int("pMoney",PlayerInfo[playerid][pMoney]);
INI_Int("pAdmin",PlayerInfo[playerid][pAdmin]);
INI_Int("pHelper",PlayerInfo[playerid][pHelper]);
INI_Int("pMember",PlayerInfo[playerid][pMember]);
INI_Int("pLeader",PlayerInfo[playerid][pLeader]);
INI_Int("pSex",PlayerInfo[playerid][pSex]);
INI_Int("pAge",PlayerInfo[playerid][pAge]);
INI_Int("pEmail",PlayerInfo[playerid][pEmail]);
INI_Int("pSkin",PlayerInfo[playerid][pSkin]);
INI_Int("pLanguage",PlayerInfo[playerid][pLanguage]);
return 1;
}