Next dialog is not showing up.. I don't understand why!
#1

So I need help with second dialog is not showing up (dregister5)...


My list of dialogs
pawn Код:
#define dregister 1
#define dlogin 2
#define dregister1 3
#define dregister2 4
#define DIALOG_CLICK 5
#define DIALOG_ADMIN 6
#define RCON_DIALOG 7
#define dregister3 8
#define dregister4 9
#define dregister5 10
#define dregister6 11
pawn Код:
if (dialogid == dregister4)
    {
        if(strlen(inputtext))
        {
            new year, month,day;
            getdate(year, month, day);
            new DateInfo[3][20];
            split(inputtext, DateInfo, '/'); //<--- Here is the error (( text is not defined )) but how to define it??
            if(year - strval(DateInfo[2]) > 100 || strval(DateInfo[2]) < 1 || strval(DateInfo[2]) >= year)
            {
                ShowPlayerDialog(playerid,dregister4,DIALOG_STYLE_INPUT,"Error","When is your Birthday? ( DD/MM/YYYY )","Enter","Next");
                return 0;
            }
            new check = year - strval(DateInfo[2]);
            if(check == year)
            {
                ShowPlayerDialog(playerid,dregister4,DIALOG_STYLE_INPUT,"Error","When is your Birthday? ( DD/MM/YYYY )","Enter","Next");
                return 0;
            }
            if(strval(DateInfo[1]) > month)
            {
                check -= 1;
            }
            else if(strval(DateInfo[1]) == month && strval(DateInfo[0]) > day)
            {
                check -= 1;
            }
            pInfo[playerid][Age] = check;
            return 0;
        }
        ShowPlayerDialog(playerid, dregister5, DIALOG_STYLE_LIST, "What is your religious position?", "Christian\n Islam\n Buddhism\n Judaism\n Atheist", "Select", "Cancel");
    }
    if (dialogid == dregister5)
    {
        if (response)
        {
            if (listitem == 0)
            {
                SendClientMessage(playerid, green, "Your current religion Christian");
                pInfo[playerid][Religion] = 0;

            }
            if (listitem == 1)
            {
                SendClientMessage(playerid, green, "Your current religion Islam");
                pInfo[playerid][Religion] = 1;
            }
            if (listitem == 3)
            {
                SendClientMessage(playerid, green, "Your current religion Buddhism");
                pInfo[playerid][Religion] = 3;
            }
           
            if (listitem == 7)
            {
                SendClientMessage(playerid, green, "Your current religion Judaism");
                pInfo[playerid][Religion] = 7;
            }
            if (listitem == 14)
            {
                SendClientMessage(playerid, green, "Your current religion Atheist");
                pInfo[playerid][Religion] = 14;
            }
        }
        else
        {
            ShowPlayerDialog(playerid, dregister5, DIALOG_STYLE_LIST, "What is your religious position?", "Christian\nIslam\nHinduism\nBuddhism\nJudaism\nAtheist", "Select", "Cancel");
        }
        ShowPlayerDialog(playerid, dregister6, DIALOG_STYLE_LIST, "Which fighting style you would like to learn?", "Normal\nBoxing\nKungFu\nKnee Head\nGrab Kick\nElbow ", "Purchase", "Cancel");
    }
Reply
#2

You are showing dregister6 when the dregister5 response is called- no matter if the response was 0 or 1. So...

pawn Код:
ShowPlayerDialog(playerid, dregister6, DIALOG_STYLE_LIST, "Which fighting style you would like to learn?", "Normal\nBoxing\nKungFu\nKnee Head\nGrab Kick\nElbow ", "Purchase", "Cancel");
Should be:

pawn Код:
else ShowPlayerDialog(playerid, dregister6, DIALOG_STYLE_LIST, "Which fighting style you would like to learn?", "Normal\nBoxing\nKungFu\nKnee Head\nGrab Kick\nElbow ", "Purchase", "Cancel");
Reply
#3

With fighting styles all is okay.. Problem is with religion script!
Correct me if I'm correct if it press cancel then it will show dialog dregister6?

Not jump back on dregister5?
Reply
#4

Bump! Tryed his version but still didn't get it work!
Reply
#5

This should work:
pawn Код:
if (dialogid == dregister4)
    {
        if(strlen(inputtext))
        {
            new year, month,day;
            getdate(year, month, day);
            new DateInfo[3][20];
            split(inputtext, DateInfo, '/'); //<--- Here is the error (( text is not defined )) but how to define it??
            if(year - strval(DateInfo[2]) > 100 || strval(DateInfo[2]) < 1 || strval(DateInfo[2]) >= year)
            {
                ShowPlayerDialog(playerid,dregister4,DIALOG_STYLE_INPUT,"Error","When is your Birthday? ( DD/MM/YYYY )","Enter","Next");
                return 0;
            }
            new check = year - strval(DateInfo[2]);
            if(check == year) return ShowPlayerDialog(playerid,dregister4,DIALOG_STYLE_INPUT,"Error","When is your Birthday? ( DD/MM/YYYY )","Enter","Next");
            if(strval(DateInfo[1]) > month)
            {
                check -= 1;
            }
            else if(strval(DateInfo[1]) == month && strval(DateInfo[0]) > day)
            {
                check -= 1;
            }
            pInfo[playerid][Age] = check;
        }
        //else return ShowPlayerDialog...
        ShowPlayerDialog(playerid, dregister5, DIALOG_STYLE_LIST, "What is your religious position?", "Christian\n Islam\n Buddhism\n Judaism\n Atheist", "Select", "Cancel");
        return 1;
    }
    if (dialogid == dregister5)
    {
        if (response)
        {
            if (listitem == 0)
            {
                SendClientMessage(playerid, green, "Your current religion Christian");
                pInfo[playerid][Religion] = 0;

            }
            if (listitem == 1)
            {
                SendClientMessage(playerid, green, "Your current religion Islam");
                pInfo[playerid][Religion] = 1;
            }
            if (listitem == 3)
            {
                SendClientMessage(playerid, green, "Your current religion Buddhism");
                pInfo[playerid][Religion] = 3;
            }

            if (listitem == 7)
            {
                SendClientMessage(playerid, green, "Your current religion Judaism");
                pInfo[playerid][Religion] = 7;
            }
            if (listitem == 14)
            {
                SendClientMessage(playerid, green, "Your current religion Atheist");
                pInfo[playerid][Religion] = 14;
            }
        }
        else return ShowPlayerDialog(playerid, dregister5, DIALOG_STYLE_LIST, "What is your religious position?", "Christian\nIslam\nHinduism\nBuddhism\nJudaism\nAtheist", "Select", "Cancel");
        ShowPlayerDialog(playerid, dregister6, DIALOG_STYLE_LIST, "Which fighting style you would like to learn?", "Normal\nBoxing\nKungFu\nKnee Head\nGrab Kick\nElbow ", "Purchase", "Cancel");
        return 1;
    }
Well first of all, you are returning 0, therefore ending the code before it has a chance to show the dialog. It will only work if the player CANCELLED the dialog, which is incorrect.

pawn Код:
pInfo[playerid][Age] = check; //Set Player Age
            return 0; //END CODE!!
        } //Anything past the 'return' does not get called if it follows the same conditions
        ShowPlayerDialog(playerid, dregister5, DIALOG_STYLE_LIST, "What is your religious position?", "Christian\n Islam\n Buddhism\n Judaism\n Atheist", "Select", "Cancel"); //This is past return and will not get called if the player responds to the dialog.
    }
Secondly, I think you might have a few issues with your religion dialog as well... your 'listitem' is going up to 14, when there are only 5 possible options, therefore the maximum listitem you should be using, is around 4...
Reply
#6

Yeah but when I enter borth data it is only working when I press exit.. so still the same thing!
Reply
#7

Sorry I probably should have made it more obvious, I added a commented line in.
pawn Код:
//else return ShowPlayerDialog...
Just remove the "//" and edit it, so it will show the dialog dregister4 for 'playerid'.
Example:
pawn Код:
else return SendClientMessage(playerid, dregister4, DIALOG_STYLE_INPUT, "Age", "What is your age?", "Confirm", "Exit");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)