SA-MP Forums Archive
Next line problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Next line problem (/showthread.php?tid=370939)



Next line problem - kbalor - 21.08.2012

Problem is that in Account Commands after I click Back its closes and nothing happen, It must go back to Player Commands dialog right?? As you can see //Next Button //Back Button the word else..

The only working is when I do /cd - it shows Basic Commands and that is right, If I click >> Then Player Commands will show and that's correct too, and last If I click next the Account Commands will show and that's correct. The only problem is the Back under Account Commands.

pawn Код:
CMD:cd(playerid, params[])
{
    new str[512];
    strcat(str, "Basic Commands:\n\n");
    strcat(str, "/id -- Search player ID using Player part name\n");
    strcat(str, "/pm -- Send private message to a player\n");
    ShowPlayerDialog(playerid, DIALOG_COMMANDS, DIALOG_STYLE_MSGBOX, "Commands", str, ">>", "Close");
    return 1;
}
pawn Код:
Under OnDialogResponse
if(dialogid == DIALOG_COMMANDS && response)
    {
        new str[512];
        strcat(str, "Player Commands:\n\n");
        strcat(str, "/stats -- Show specified player statistics\n");
        strcat(str, "/kill -- Suicide\n");
        ShowPlayerDialog(playerid, DIALOG_COMMANDS + 1, DIALOG_STYLE_MSGBOX, "Commands", str, ">>", "Back");
        return 1;
    }
    if(dialogid == DIALOG_COMMANDS + 1)
    {
        if(response) //Next Button
        {
            new str[256];
            strcat(str, "Account Commands:\n\n");
            strcat(str, "/register -- register for a new account\n");
            strcat(str, "/login -- login your registered account\n");
            ShowPlayerDialog(playerid, DIALOG_COMMANDS + 2, DIALOG_STYLE_MSGBOX, "Commands", str, ">>", "Back");
        }
        else //Back Button
        {
            new str[512];
            strcat(str, "Player Commands:\n\n");
            strcat(str, "/stats -- Show specified player statistics\n");
            ShowPlayerDialog(playerid, DIALOG_COMMANDS, DIALOG_STYLE_MSGBOX, "Commands", str, ">>", "Close");
        }
    }
    return 1;
}



Re: Next line problem - Shetch - 21.08.2012

Код:
ShowPlayerDialog(playerid, DIALOG_COMMANDS, DIALOG_STYLE_MSGBOX, "Commands", str, ">>", "Close");
You didn't add the '+ 1'...
Код:
ShowPlayerDialog(playerid, DIALOG_COMMANDS + 1, DIALOG_STYLE_MSGBOX, "Commands", str, ">>", "Close");



Re: Next line problem - kbalor - 22.08.2012

Quote:
Originally Posted by Shetch
Посмотреть сообщение
Код:
ShowPlayerDialog(playerid, DIALOG_COMMANDS, DIALOG_STYLE_MSGBOX, "Commands", str, ">>", "Close");
You didn't add the '+ 1'...
Код:
ShowPlayerDialog(playerid, DIALOG_COMMANDS + 1, DIALOG_STYLE_MSGBOX, "Commands", str, ">>", "Close");
Doesn't work. It messing the dialog..


Re: Next line problem - kbalor - 22.08.2012

Anyone really need to fix this.. Thanks in advanced.


Re: Next line problem - Shetch - 22.08.2012

Seems like everything in the script should work...
Maybe you have other dialogs with the same ID?


Re: Next line problem - Shetch - 22.08.2012

Try this:

Код:
	else //Back Button
        {
            new str[512] = "Player Commands:\n\n";
            strcat(str, "/stats -- Show specified player statistics\n");
            ShowPlayerDialog(playerid, DIALOG_COMMANDS, DIALOG_STYLE_MSGBOX, "Commands", str, ">>", "Close");
        }



Re: Next line problem - clarencecuzz - 22.08.2012

I would check to make sure that there are no other filterscripts/gamemodes with the same dialog ids in them, otherwise try returning 0 instead of 1 at the end of OnDialogResponse.


Re: Next line problem - kbalor - 22.08.2012

Quote:
Originally Posted by Shetch
Посмотреть сообщение
Try this:

Код:
	else //Back Button
        {
            new str[512] = "Player Commands:\n\n";
            strcat(str, "/stats -- Show specified player statistics\n");
            ShowPlayerDialog(playerid, DIALOG_COMMANDS, DIALOG_STYLE_MSGBOX, "Commands", str, ">>", "Close");
        }
After I clicked Back it show's this but it must be Basic Commands Dialog..

@clarencecuzz - i did still no luck. Do I need to make another Dialog Box?


Re: Next line problem - kbalor - 22.08.2012

Still nothing.. After I click next in Account Commands. It close how do I add dialog box next to Account commands??