Help me please? i really need help
#5

This should work tho
Change this
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_REGISTER)
    {
        if(response)
        {
            if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register on PBRP","Welcome to PBRP! This account is not registered.\nEnter your password below to create the account account.","Register","Quit");
            new INI:File = INI_Open(UserPath(playerid));
            INI_SetTag(File,"PBRP User Database");
            INI_WriteInt(File,"Password",udb_hash(inputtext));
            INI_WriteInt(File,"Admin",0);
            INI_WriteInt(File,"Money",0);
            INI_WriteInt(File,"Level",0);
            INI_WriteInt(File,"Skin",0);
            INI_Close(File);
            SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
            SpawnPlayer(playerid);
            SendClientMessage(playerid,-1,"Welcome to PBRP! You have successfully registered.");
        }
        else Kick(playerid);
    }
    else if(dialogid == DIALOG_LOGIN)
    {
        if( response )
        {
            if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
            {
                INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
                GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
                SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
                SendClientMessage(playerid,-1,"Welcome back to PBRP! You have successfully logged in.");
            }
            else
            {
                ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login on PBRP","Welcome back to PBRP! This account is registered.\nEnter your password below to login to your account.","Login","Quit");
            }
            return 1;
        }
        else Kick(playerid);
    }
    return 1;
}
to this
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_REGISTER)
    {
        if(response)
        {
            if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register on PBRP","Welcome to PBRP! This account is not registered.\nEnter your password below to create the account account.","Register","Quit");
            new INI:File = INI_Open(UserPath(playerid));
            INI_SetTag(File,"data"); //changed this back to data || Because your INI_ParseFile is "LoadUser_data"
            INI_WriteInt(File,"Password",udb_hash(inputtext));
            INI_WriteInt(File,"Admin",0);
            INI_WriteInt(File,"Money",0);
            INI_WriteInt(File,"Level",0);
            INI_WriteInt(File,"Skin",0);
            INI_Close(File);
            SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
            SpawnPlayer(playerid);
            SendClientMessage(playerid,-1,"Welcome to PBRP! You have successfully registered.");
        }
        else Kick(playerid);
    }
    else if(dialogid == DIALOG_LOGIN)
    {
        if( response )
        {
            if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
            {
                INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
                GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
                SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
                SendClientMessage(playerid,-1,"Welcome back to PBRP! You have successfully logged in.");
            }
            else
            {
                ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login on PBRP","Welcome back to PBRP! This account is registered.\nEnter your password below to login to your account.","Login","Quit");
            }
            return 1;
        }
        else Kick(playerid);
    }
    return 1;
}
Reply


Messages In This Thread
Help me please? i really need help - by Wizz123 - 24.01.2014, 16:10
Re: Help me please? i really need help - by DaniceMcHarley - 24.01.2014, 17:56
Re: Help me please? i really need help - by Wizz123 - 24.01.2014, 18:02
Re: Help me please? i really need help - by CH | FuDo - 24.01.2014, 18:07
Re: Help me please? i really need help - by FailerZ - 24.01.2014, 19:21
Re: Help me please? i really need help - by Wizz123 - 24.01.2014, 19:44

Forum Jump:


Users browsing this thread: 3 Guest(s)