Login bug again :|
#1

pawn Код:
if(dialogid == 667)
        {
            if(response)
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    gPlayerLogged[playerid] = 1;
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    SCM(playerid, COLOR_RED, "You have logged in. You may now spawn.");
                }
                else
                {
                    gPlayer[playerid] += 1;

                    if(gPlayer[playerid] == 1)
                    {
                        SCM(playerid, COLOR_RED, "Wrong Password. 1/3");
                    }

                    if(gPlayer[playerid] == 2)
                    {
                        SCM(playerid, COLOR_RED, "Wrong Password. 2/3");
                    }

                   
                    {
                        SCM(playerid, COLOR_RED, "Wrong Password. 3/3. You have been kicked.");
                        Kick(playerid);
                    }
                }
            }
        }
    }
    return 1;
}
When the dialog pops up and I press accept, it shuts the dialog and nothing happends..
Reply
#2

Bump
Reply
#3

Do you have AddPlayerClass anywhere in your script? and do you see the left and right arrows and the spawn button, or is the screen just blank?
Reply
#4

Go two questions !
(1) is there any other dialo I'd with the same ID that might be inturupting it ?
(2) is the "Accept" buton on left ot right side ? (what I mean is to check if it is "response")
Edit
Too many closing brackets !
Also there is an unknown statement where u open a bracket with ought a check !
Reply
#5

use lethal admin
Reply
#6

Quote:
Originally Posted by Cpt.Shady
Посмотреть сообщение
use lethal admin
No. That might be the most unhelpful piece of advice I have ever received on the SA-MP Forums.
Quote:
Originally Posted by park4bmx
Посмотреть сообщение
Go two questions !
(1) is there any other dialo I'd with the same ID that might be inturupting it ?
(2) is the "Accept" buton on left ot right side ? (what I mean is to. Heck if it is "response")
1. Nope
2. You're looking for this.. Right?
pawn Код:
if(fexist(UserPath(playerid)))
        {
            if(gPlayerLogged[playerid] == 0){
            ShowPlayerDialog(playerid, 667, DIALOG_STYLE_INPUT, "Login", "Type your password here.", "Submit", "Cancel");
        }
1. Nope
Reply
#7

Might wanna add a !response and kick them if they don't respond. The no-response code is trying to run, but it has nothing to run.
Reply
#8

...Explain?
Reply
#9

You forgot the "else" word on your last statement. Hopefully, that's the only problem.

Try this:
pawn Код:
if(dialogid == 667)
{
    if(response)
    {
        if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
        {
            INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
            gPlayerLogged[playerid] = 1;
            GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
            SCM(playerid, COLOR_RED, "You have logged in. You may now spawn.");
        }
        else
        {
            gPlayer[playerid] += 1;

            if(gPlayer[playerid] == 1)
            {
                SCM(playerid, COLOR_RED, "Wrong Password. 1/3");
            }

            if(gPlayer[playerid] == 2)
            {
                SCM(playerid, COLOR_RED, "Wrong Password. 2/3");
            }

            else
            {
                SCM(playerid, COLOR_RED, "Wrong Password. 3/3. You have been kicked.");
                Kick(playerid);
            }
        }
    }
}
NOTE: I removed two closing brackets and "return 1;" on the last part.
Reply
#10

pawn Код:
if(dialogid == 667)
{
    if(response)
    {
        if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
        {
            INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
            gPlayerLogged[playerid] = 1;
            GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
            SCM(playerid, COLOR_RED, "You have logged in. You may now spawn.");
        }
        else
        {
            gPlayer[playerid] += 1;

            if(gPlayer[playerid] == 1)
            {
                SCM(playerid, COLOR_RED, "Wrong Password. 1/3");
            }else if(gPlayer[playerid] == 2)
            {
                SCM(playerid ,COLOR_RED, "Wrong Password. 2/3");
            }else  if(gPlayer[playerid] == 3){
                SCM(playerid, COLOR_RED, "Wrong Password. 3/3. You have been kicked.");
                Kick(playerid);
            }
        }
    }
}
Just needed to sort out the warnings becouse if there is an else a the end when the "if" statements are seperate that will kick the player if his warning is "=0" too becouse is checking for 1,2 at the same time and when I checks for 2 and is not 2 then it will kick him
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)