Next Dialog >> and Back <<
#1

After typing /cmdlist and the first dialog appear(Base Commands) after clicking >> or the next button nothing happens it just close, why?

I've already checked all dialog ids and returning ondialogresponse nothing same id's and return 0.




pawn Код:
#define DIALOG_COMMANDS_1 11110 // 1. dialog ,open with CMD
#define DIALOG_COMMANDS_2 11111 // 2. dialog
#define DIALOG_COMMANDS_3 11112 // 3. dialog
#define DIALOG_COMMANDS_4 11113 // 4. dialog

pawn Код:
CMD:cmdlist(playerid, params[])
{
        new str[512];
        strcat(str, "Base Commands:\n\n");
        strcat(str, "/id \t\t-- \tSearch player ID using Player part name\n");
        strcat(str, "/pm \t\t-- \tSend private message to a player\n");
        strcat(str, "/pmo \t\t-- \tToggle PM enabled/disabled\n");
        strcat(str, "/go \t\t-- \tTeleport to an Specified player\n");
        ShowPlayerDialog(playerid, DIALOG_COMMANDS_1, DIALOG_STYLE_MSGBOX, "Base Commands", str, ">>", "Close");
        return 1;
}
Under
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
pawn Код:
new str1[512] ,str2[512] ,str3[512] ,str4[512];
    if(dialogid == DIALOG_COMMANDS_1)
    {
        strcat(str1, "Base Commands:\n\n");
        strcat(str1, "/id \t\t-- \tSearch player ID using Player part name\n");
        strcat(str1, "/pm \t\t-- \tSend private message to a player\n");
        strcat(str1, "/pmo \t\t-- \tToggle PM enabled/disabled\n");
        if(response) return ShowPlayerDialog(playerid ,DIALOG_COMMANDS_2 ,DIALOG_STYLE_MSGBOX, "Account Commands", str2, ">>", "<<");
        else return 1;
    }
    if(dialogid == DIALOG_COMMANDS_2)
    {
        strcat(str2, "Account Commands:\n\n");
        strcat(str2, "/register \t\t-- \tregister for a new account\n");
        strcat(str2, "/login \t\t\t-- \tlogin your registered account\n");
        if(response) return ShowPlayerDialog(playerid ,DIALOG_COMMANDS_3 ,DIALOG_STYLE_MSGBOX, "Player Commands", str3, ">>", "<<");
        else return ShowPlayerDialog(playerid, DIALOG_COMMANDS_1, DIALOG_STYLE_MSGBOX, "Base Commands", str1, ">>", "Close");
    }
    if(dialogid == DIALOG_COMMANDS_3)
    {
        strcat(str3, "Player Commands:\n\n");
        strcat(str3, "/stats \t\t-- \tShow specified player statistics\n");
        strcat(str3, "/kill \t\t-- \tSuicide\n");
        if(response) return ShowPlayerDialog(playerid ,DIALOG_COMMANDS_4 ,DIALOG_STYLE_MSGBOX, "Vehicle Commands", str4, "<<", "Close");
        else return ShowPlayerDialog(playerid ,DIALOG_COMMANDS_2 ,DIALOG_STYLE_MSGBOX, "Account Commands", str2, ">>", "<<");
    }
    if ( dialogid == DIALOG_COMMANDS_4)
    {
        strcat(str4, "Vehicle Commands:\n\n");
        strcat(str4, "/v \t\t-- \tShow specified player statistics\n");
        strcat(str4, "/flip \t\t-- \tSuicide\n");
        strcat(str4, "/fix \t\t-- \tChange Skin\n");
        strcat(str4, "/park \t\t-- \tFall in specified Height\n");
        strcat(str4, "/tune \t-- \tChange Time\n");
        if(response) return ShowPlayerDialog(playerid ,DIALOG_COMMANDS_3 ,DIALOG_STYLE_MSGBOX, "Player Commands", str3, ">>", "<<");
        else return 1;
    }
Reply
#2

do you use
pawn Код:
if(!response)
            {
                return 1;
            }
if(response)
            {
                return 1;
            }
Reply
#3

Quote:
Originally Posted by _Khaled_
Посмотреть сообщение
do you use
pawn Код:
if(!response)
            {
                return 1;
            }
if(response)
            {
                return 1;
            }
Learn to read the code first then reply.

--------------------------------------------------

i believe that will work

under OnDialogResponse:

pawn Код:
new str1[512] ,str2[512] ,str3[512] ,str4[512];

    strcat(str1, "Base Commands:\n\n");
    strcat(str1, "/id \t\t-- \tSearch player ID using Player part name\n");
    strcat(str1, "/pm \t\t-- \tSend private message to a player\n");
    strcat(str1, "/pmo \t\t-- \tToggle PM enabled/disabled\n");

    strcat(str2, "Account Commands:\n\n");
    strcat(str2, "/register \t\t-- \tregister for a new account\n");
    strcat(str2, "/login \t\t\t-- \tlogin your registered account\n");

    strcat(str3, "Player Commands:\n\n");
    strcat(str3, "/stats \t\t-- \tShow specified player statistics\n");
    strcat(str3, "/kill \t\t-- \tSuicide\n");

    strcat(str3, "Player Commands:\n\n");
    strcat(str3, "/stats \t\t-- \tShow specified player statistics\n");
    strcat(str3, "/kill \t\t-- \tSuicide\n");

    strcat(str4, "Vehicle Commands:\n\n");
    strcat(str4, "/v \t\t-- \tShow specified player statistics\n");
    strcat(str4, "/flip \t\t-- \tSuicide\n");
    strcat(str4, "/fix \t\t-- \tChange Skin\n");
    strcat(str4, "/park \t\t-- \tFall in specified Height\n");
    strcat(str4, "/tune \t-- \tChange Time\n");

    if(dialogid == DIALOG_COMMANDS_1)
    {
        if(response) return ShowPlayerDialog(playerid ,DIALOG_COMMANDS_2 ,DIALOG_STYLE_MSGBOX, "Account Commands", str2, ">>", "<<");
        else return 1;
    }
    if(dialogid == DIALOG_COMMANDS_2)
    {
        if(response) return ShowPlayerDialog(playerid ,DIALOG_COMMANDS_3 ,DIALOG_STYLE_MSGBOX, "Player Commands", str3, ">>", "<<");
        else return ShowPlayerDialog(playerid, DIALOG_COMMANDS_1, DIALOG_STYLE_MSGBOX, "Base Commands", str1, ">>", "Close");
    }
    if(dialogid == DIALOG_COMMANDS_3)
    {
        if(response) return ShowPlayerDialog(playerid ,DIALOG_COMMANDS_4 ,DIALOG_STYLE_MSGBOX, "Vehicle Commands", str4, "<<", "Close");
        else return ShowPlayerDialog(playerid ,DIALOG_COMMANDS_2 ,DIALOG_STYLE_MSGBOX, "Account Commands", str2, ">>", "<<");
    }
    if ( dialogid == DIALOG_COMMANDS_4)
    {
        if(response) return ShowPlayerDialog(playerid ,DIALOG_COMMANDS_3 ,DIALOG_STYLE_MSGBOX, "Player Commands", str3, ">>", "<<");
        else return 1;
    }
Reply
#4

Quote:
pawn Код:
if(dialogid == DIALOG_COMMANDS_1)
    {
        if(response) return ShowPlayerDialog(playerid ,DIALOG_COMMANDS_2 ,DIALOG_STYLE_MSGBOX, "Account Commands", str2, ">>", "<<");
        else return 1;
    }
    if(dialogid == DIALOG_COMMANDS_2)
    {
        if(response) return ShowPlayerDialog(playerid ,DIALOG_COMMANDS_3 ,DIALOG_STYLE_MSGBOX, "Player Commands", str3, ">>", "<<");
        else return ShowPlayerDialog(playerid, DIALOG_COMMANDS_1, DIALOG_STYLE_MSGBOX, "Base Commands", str1, ">>", "Close");
    }
    if(dialogid == DIALOG_COMMANDS_3)
    {
        if(response) return ShowPlayerDialog(playerid ,DIALOG_COMMANDS_4 ,DIALOG_STYLE_MSGBOX, "Vehicle Commands", str4, "<<", "Close");
        else return ShowPlayerDialog(playerid ,DIALOG_COMMANDS_2 ,DIALOG_STYLE_MSGBOX, "Account Commands", str2, ">>", "<<");
    }
    if ( dialogid == DIALOG_COMMANDS_4)
    {
        if(response) return ShowPlayerDialog(playerid ,DIALOG_COMMANDS_3 ,DIALOG_STYLE_MSGBOX, "Player Commands", str3, ">>", "<<");
        else return 1;
    }
lmfao, yea.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)