Dialog not appearing
#1

This dialog is not appearing...

pawn Код:
new dstring[124];
            format(dstring, sizeof(dstring), "Please select your new sex that you want to change to:");
            ShowPlayerDialog(playerid, REGISTRATION1,DIALOG_STYLE_MSGBOX,"Government(U.S. Registration) - Account Sex Management",dstring,"Male","Female");
pawn Код:
if(dialogid == REGISTRATION1)
        {
            if(response == 1)

            {
                PlayerInfo[playerid][pSex] = 1;
                SendClientMessage(playerid,COLOR_GRAD3,"You are now a Male");
                new dstring[124];
                format(dstring, sizeof(dstring), "Please input your age, make sure you are 17 or older");
                ShowPlayerDialog(playerid, REGISTRATION2,DIALOG_STYLE_INPUT,"Government(U.S. Registration) - Account Age Management",dstring,"Ok","Back");
                SavePlayerData(playerid);
            }
            else
            {
                PlayerInfo[playerid][pSex] = 2;
                SendClientMessage(playerid,COLOR_GRAD3,"You are now a Female");
                new dstring[124];
                format(dstring, sizeof(dstring), "Please input your age, make sure you are 17 or older");
                ShowPlayerDialog(playerid,REGISTRATION2,DIALOG_STYLE_INPUT,"Government(U.S. Registration) - Account Age Management",dstring,"Ok","Back");
                SavePlayerData(playerid);
            }
            }
        }
Reply
#2

Show your 'REGISTRATION1' define , if it is higher than 32767 it won't work.The limit for dialog IDs is 32767... (at least this is what I know , maybe it's wrong)
Reply
#3

Dialog ID's were too high, but now it isnt switching to the next dialog..
Reply
#4

Just thinking out loud here..
Why would format a string when you don't even use wildcards?
pawn Код:
ShowPlayerDialog(playerid, REGISTRATION1,DIALOG_STYLE_MSGBOX,"Government(U.S. Registration) - Account Sex Management","Please select your new sex that you want to change to:","Male","Female");
OnDialogResponse:
pawn Код:
if(dialogid == REGISTRATION1)
{
    if(response)
    {
        PlayerInfo[playerid][pSex] = 1;
        SendClientMessage(playerid,COLOR_GRAD3,"You are now a Male");
    }
    else
    {
        PlayerInfo[playerid][pSex] = 2;
        SendClientMessage(playerid,COLOR_GRAD3,"You are now a Female");
    }
    ShowPlayerDialog(playerid, REGISTRATION2,DIALOG_STYLE_INPUT,"Government(U.S. Registration) - Account Age Management","Please input your age, make sure you are 17 or older:","Ok","Back");
    SavePlayerData(playerid);
}
Show the context of the first line, maybe the problem is caused by something in there?
Reply
#5

Here alll my dialog responses for the registration

pawn Код:
if(dialogid == REGISTRATION1)
        {
            if(response)
            {
                PlayerInfo[playerid][pSex] = 1;
                SendClientMessage(playerid,COLOR_GRAD3,"You are now a Male");
            }
            else
            {
                PlayerInfo[playerid][pSex] = 2;
                SendClientMessage(playerid,COLOR_GRAD3,"You are now a Female");
            }
            ShowPlayerDialog(playerid, REGISTRATION2,DIALOG_STYLE_INPUT,"Government(U.S. Registration) - Account Age Management","Please input your age, make sure you are 17 or older:","Ok","Back");
            SavePlayerData(playerid);
            }
        }
        if(dialogid == REGISTRATION2)
        {
            if (response == 1)
            {
                if(IsNull(inputtext))
                {
                    SendClientMessage(playerid, COLOR_WHITE, "[ERROR] Type a number in...");
                    return 1;
                }
                if(strval(inputtext) <= 16)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "[ERROR] Over 17, please");
                    return 1;
                }
                if(strval(inputtext) >= 60)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "[ERROR] Under 60, please");
                    return 1;
                }
                PlayerInfo[playerid][pAge] = strval(inputtext);
                new string[256], dstring[124];
                format(string, sizeof(string), "Your age is now %d ",PlayerInfo[playerid][pAge]);
                SendClientMessage(playerid,COLOR_WHITE,string);
                SavePlayerData(playerid);
                format(dstring, sizeof(dstring), "United States of America\nEurope\nAsia\nAfrica\nRussia");
                ShowPlayerDialog(playerid,DACCT6,DIALOG_STYLE_LIST,"Government(U.S. Registration) - Account Origin Management",dstring,"Select","Back");
            }
            return 0;
        }
        if (dialogid == REGISTRATION3)
        {
            if (response == 1)
            {
                switch (listitem)
                {
                    case 0:
                    {
                        PlayerInfo[playerid][pOrigin] = 1;
                        SendClientMessage(playerid,COLOR_GRAD3,"You are now from United States Of America");
                        SetPlayerInterior(playerid, 0);
                        SetPlayerPos(playerid, 1642.2334,-2240.4983,13.4952);
                        SetCameraBehindPlayer(playerid);
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        SavePlayerData(playerid);
                    }
                    case 1:
                    {
                        PlayerInfo[playerid][pOrigin] = 2;
                        SendClientMessage(playerid,COLOR_GRAD3,"You are now from Europe");
                        SetPlayerInterior(playerid, 0);
                        SetPlayerPos(playerid, 1642.2334,-2240.4983,13.4952);
                        SetCameraBehindPlayer(playerid);
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        SavePlayerData(playerid);
                    }
                    case 2:
                    {
                        PlayerInfo[playerid][pOrigin] = 3;
                        SendClientMessage(playerid,COLOR_GRAD3,"You are now from Asia");
                        SetPlayerInterior(playerid, 0);
                        SetPlayerPos(playerid, 1642.2334,-2240.4983,13.4952);
                        SetCameraBehindPlayer(playerid);
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        SavePlayerData(playerid);
                    }
                    case 3:
                    {
                        PlayerInfo[playerid][pOrigin] = 4;
                        SendClientMessage(playerid,COLOR_GRAD3,"You are now from Africa");
                        SetPlayerInterior(playerid, 0);
                        SetPlayerPos(playerid, 1642.2334,-2240.4983,13.4952);
                        SetCameraBehindPlayer(playerid);
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        SavePlayerData(playerid);
                    }
                    case 4:
                    {
                        PlayerInfo[playerid][pOrigin] = 5;
                        SendClientMessage(playerid,COLOR_GRAD3,"You are now from Russia");
                        SetPlayerInterior(playerid, 0);
                        SetPlayerPos(playerid, 1642.2334,-2240.4983,13.4952);
                        SetCameraBehindPlayer(playerid);
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        SavePlayerData(playerid);
                    }
                }
            }
            return 0;
        }
pawn Код:
#define REGISTRATION1 12348
#define REGISTRATION2 20620
#define REGISTRATION3 20640
Basically it
Reply
#6

You have a bracket too much in the first if.
Copy mine 2 posts ago, and you're fine.
You can also just delete the second }.

BTW: Ever thought about using switch in OnDialogResponse?
Reply
#7

Nah, it gives me errors, I need 2 for some reasons
Reply
#8

Then you must have more code around the if(dialogid == REGISTRATION1)
The OnDialogResponse you gave has a bracket too much..
Reply
#9

Quote:
Originally Posted by Pangea
Посмотреть сообщение
Then you must have more code around the if(dialogid == REGISTRATION1)
The OnDialogResponse you gave has a bracket too much..
I'll move it, and check if that works
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)