Dialog Style list , button2?
#1

how can I validate the second button?


Button 2 is an example of someone I want to use?
Reply
#2

Normally the second button is CANCELLATION or Quit something like dialog disappears.

But you can validate by using "else".
Reply
#3

As Bingo already said, the second button is just to cancel.

You can however detect when the button is pressed, if there is no response, like this:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 0) // your dialog id
    {
        if(response) {
            // button1
        }
        else {
            // button2
        }
    }
    return 0;
}
Reply
#4

Yeah, but if he does, it means even if the player presses "esc", it will have a response.

Guess what will happen. No way to exit the dialog, except doing the action told in the dialog. And if the dialog is used to buy items, and if the player doesn't have enough, he will be forced to make him crash or to kill the process and then reconnect.

Think it : the !response should be used only on a case which won't made an infinite dialog.
If you just want the player to accept, don't use "button2".

PHP код:

ShowPlayerDialog
(playerid666DIALOG_STYLE_LIST"caption""info\ninfo\ninfo""Button1"""); 
Reply
#5

If you don't have any code under the "no response" part, then it won't do anything and it will just close the dialog. If you add some code in it, then it will do what you wrote it to do.

Pressing Esc button is like clicking the second button and the player will be able to exit the dialog unless you show another dialog in the code you wrote.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)