Dialog Problem
#1

Hello there,

I want to know why my 'age' dialog isn't showing up

here is my code:

PHP код:
if(dialogid == 3)//Gender
           
{
               if(
response)
               {
                   
SendClientMessage(playerid, -1""COL_GREEN"So, you are male.");
                   
pData[playerid][pGender] = 1;
                   
ShowPlayerDialog(playeridD_AGEDIALOG_STYLE_INPUT"eL-RP:Age""{FFFFFF}Choose Your Age, Only Available Ages Are From 18 to 90"COL_GREEN"(18-90)""Done""");
               }
               else {
                   
SendClientMessage(playerid, -1""COL_GREEN"So, you are female.");
                   
pData[playerid][pGender] = 2;
                   
ShowPlayerDialog(playeridD_AGEDIALOG_STYLE_INPUT"eL-RP:Age""{FFFFFF}Choose Your Age, Only Available Ages Are From 18 to 90"COL_GREEN"(18-90)""Done""");
               }
           }
           if(
dialogid == D_AGE)//Age
           
{
               if(
response)
               {
                   if(
strlen(inputtext) > || strval(inputtext) <= 17 || strval(inputtext) >= 91)
                {
                    
ShowPlayerDialog(playeridD_AGEDIALOG_STYLE_INPUT"eL-RP:Age""{FFFFFF}Choose Your Age, Only Available Ages Are From 18 to 90"COL_GREEN"(18-90)""Done""");
                       
format(szQuery200"{FFFFFF}Your Age Must be In This Average ( "COL_RED"18{FFFFFF} - "COL_RED"24{FFFFFF}90 )");
                    
SendClientMessage(playerid, -1szQuery);
                }
                else
                {
                    
pData[playerid][pAge] = strval(inputtext);
                       
format(szQuery200""COL_BLUE"So, you are %d years-old."pData[playerid][pAge]);
                          
SendClientMessage(playerid, -1szQuery);
                       
format(szQuery200"{FFFFFF}Welcome "COL_BLUE"%s(%d){FFFFFF} to the server, you're registered\n\nPlease log in by inputting your password."szPlayerNameplayerid);
                    
ShowPlayerDialog(playeridD_LOGINDIALOG_STYLE_PASSWORD"eL-RP:Login"szQuery"Login""");
                }
               }
               else
               {
                
ShowPlayerDialog(playeridD_AGEDIALOG_STYLE_INPUT"eL-RP:Age""{FFFFFF}Choose Your Age, Only Available Ages Are From 18 to 90"COL_GREEN"(18-90)""Done""");
               }
           } 
any help I will appreciate it!
Reply
#2

Its because before you do this you need to create the function ShowPlayerDialog(playerid,ID,DIALOG_STYLE_LIST,etc .

Make sure you put this under OnPlayerConnect if they are registered or not
Reply
#3

Quote:
Originally Posted by Joshman543
Посмотреть сообщение
Its because before you do this you need to create the function ShowPlayerDialog(playerid,ID,DIALOG_STYLE_LIST,etc .

Make sure you put this under OnPlayerConnect if they are registered or not
it's not the point, you didn't get it, all the dialogs are working perfectly but IDK why exactly this one isn't working/showing up?
Reply
#4

Yes, because you have the ShowPlayerDialog under ondialogresponse
How can you respond to a dialog that hasn't been created yet? I had the same problem with my script.
Reply
#5

Quote:
Originally Posted by Joshman543
Посмотреть сообщение
Yes, because you have the ShowPlayerDialog under ondialogresponse
How can you respond to a dialog that hasn't been created yet? I had the same problem with my script.
That made sense, then to solve I have to create a 'function/stock' included in it the "dialog" I want to show?

Edit: as I said?^^.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)