Dialog help, the "cancel" kick is being called even if you dont cancel
#1

So this is my code
pawn Код:
if(dialogid == 5013)
        {
            if(response)
            {
                if(listitem == 0)
                {
                    PlayerInfo[playerid][pSex] = 1;
                    PlayerInfo[playerid][pChar] = 26;
                    ShowPlayerDialog(playerid, 5014,DIALOG_STYLE_INPUT,"Ah","So you are a male.Well how old are you?","Select","Cancel");
                }
                else if(listitem == 1)
                {
                    PlayerInfo[playerid][pSex] = 2;
                    PlayerInfo[playerid][pChar] = 91;
                    ShowPlayerDialog(playerid, 5014,DIALOG_STYLE_LIST,"Ah","So you are a female.Well how old are you?","Select","Cancel");
                }
                else
                {
                    Kick(playerid)
                }
            }
        }
        if(dialogid == 5014)
        {
            if(response)
            {
                new age = strval(inputtext);
                PlayerInfo[playerid][pAge] = age;
                new Orgin[] = "I'm from America\nI'm from Europe\nI'm from Asia\nI'm from Africa";
                ShowPlayerDialog(playerid, 5015,DIALOG_STYLE_LIST,"So where are you from?",Orgin,"Select","Cancel");
            }
            else
            {
                Kick(playerid)//This kick is being called no mather what you choose
            }
        }
Reply
#2

Try this, I added some returns:
pawn Код:
if(dialogid == 5013)
{
    if(response)
    {
        if(listitem == 0)
        {
            PlayerInfo[playerid][pSex] = 1;
            PlayerInfo[playerid][pChar] = 26;
            ShowPlayerDialog(playerid, 5014,DIALOG_STYLE_INPUT,"Ah","So you are a male.Well how old are you?","Select","Cancel");
        }
        else if(listitem == 1)
        {
            PlayerInfo[playerid][pSex] = 2;
            PlayerInfo[playerid][pChar] = 91;
            return ShowPlayerDialog(playerid, 5014,DIALOG_STYLE_LIST,"Ah","So you are a female.Well how old are you?","Select","Cancel");
        }
        else
        {
                    Kick(playerid)
        }
    }
}
if(dialogid == 5014)
{
    if(response)
    {
        new age = strval(inputtext);
        PlayerInfo[playerid][pAge] = age;
        new Orgin[] = "I'm from America\nI'm from Europe\nI'm from Asia\nI'm from Africa";
        return ShowPlayerDialog(playerid, 5015,DIALOG_STYLE_LIST,"So where are you from?",Orgin,"Select","Cancel");
    }
    else
    {
        Kick(playerid)//This kick is being called no mather what you choose
    }
}
Reply
#3

Thanks, Will try it out now
Reply
#4

Still same problem
Reply
#5

This should fix the problem, i dont see anything wrong with teh ondialogresponse. if it still doesnt work please show the showplayerdialog line.
pawn Код:
if(dialogid == 5013)
        {
            if(response)
            {
                if(listitem == 0)
                {
                    PlayerInfo[playerid][pSex] = 1;
                    PlayerInfo[playerid][pChar] = 26;
                    ShowPlayerDialog(playerid, 5014,DIALOG_STYLE_INPUT,"Ah","So you are a male.Well how old are you?","Select","Cancel");
                }
                else if(listitem == 1)
                {
                    PlayerInfo[playerid][pSex] = 2;
                    PlayerInfo[playerid][pChar] = 91;
                    ShowPlayerDialog(playerid, 5014,DIALOG_STYLE_LIST,"Ah","So you are a female.Well how old are you?","Select","Cancel");
                }
                else
                {
                    Kick(playerid)
                }
            }
            return 1;
        }
        if(dialogid == 5014)
        {
            if(response)
            {
                new age = strval(inputtext);
                PlayerInfo[playerid][pAge] = age;
                new Orgin[] = "I'm from America\nI'm from Europe\nI'm from Asia\nI'm from Africa";
                ShowPlayerDialog(playerid, 5015,DIALOG_STYLE_LIST,"So where are you from?",Orgin,"Select","Cancel");
            }
            else
            {
                Kick(playerid)//This kick is being called no mather what you choose
            }
            return 1;
        }
Reply
#6

Will try it, Thanks
Reply
#7

Nope still didnt work
Reply
#8

This would work.

pawn Код:
if(dialogid == 5013)
        {
            if(response)
            {
                if(listitem == 0)
                {
                    PlayerInfo[playerid][pSex] = 1;
                    PlayerInfo[playerid][pChar] = 26;
                    ShowPlayerDialog(playerid, 5014,DIALOG_STYLE_INPUT,"Ah","So you are a male.Well how old are you?","Select","Cancel");
                }
                else if(listitem == 1)
                {
                    PlayerInfo[playerid][pSex] = 2;
                    PlayerInfo[playerid][pChar] = 91;
                    ShowPlayerDialog(playerid, 5014,DIALOG_STYLE_LIST,"Ah","So you are a female.Well how old are you?","Select","Cancel");
                }
            }
            else
            {
                Kick(playerid)
            }
            return 1;
        }
        if(dialogid == 5014)
        {
            if(response)
            {
                new age = strval(inputtext);
                PlayerInfo[playerid][pAge] = age;
                new Orgin[] = "I'm from America\nI'm from Europe\nI'm from Asia\nI'm from Africa";
                ShowPlayerDialog(playerid, 5015,DIALOG_STYLE_LIST,"So where are you from?",Orgin,"Select","Cancel");
            }
            else
            {
                Kick(playerid)//This kick is being called no mather what you choose
            }
            return 1;
        }
you have placed this:
pawn Код:
else
            {
                Kick(playerid)
            }
Inside the response statement.
Reply
#9

That looks the same to me?
Reply
#10

In your old code it was like that:

pawn Код:
if(response)
            {
                if(listitem == 0)
                {
                    PlayerInfo[playerid][pSex] = 1;
                    PlayerInfo[playerid][pChar] = 26;
                    ShowPlayerDialog(playerid, 5014,DIALOG_STYLE_INPUT,"Ah","So you are a male.Well how old are you?","Select","Cancel");
                }
                else if(listitem == 1)
                {
                    PlayerInfo[playerid][pSex] = 2;
                    PlayerInfo[playerid][pChar] = 91;
                    ShowPlayerDialog(playerid, 5014,DIALOG_STYLE_LIST,"Ah","So you are a female.Well how old are you?","Select","Cancel");
                }
                else
                {
                    Kick(playerid)
                }
            }
And NOW:
pawn Код:
if(response)
            {
                if(listitem == 0)
                {
                    PlayerInfo[playerid][pSex] = 1;
                    PlayerInfo[playerid][pChar] = 26;
                    ShowPlayerDialog(playerid, 5014,DIALOG_STYLE_INPUT,"Ah","So you are a male.Well how old are you?","Select","Cancel");
                }
                else if(listitem == 1)
                {
                    PlayerInfo[playerid][pSex] = 2;
                    PlayerInfo[playerid][pChar] = 91;
                    ShowPlayerDialog(playerid, 5014,DIALOG_STYLE_LIST,"Ah","So you are a female.Well how old are you?","Select","Cancel");
                }
            }
            else
            {
                Kick(playerid)
            }
Man.. just look good don't reply immediately
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)