Player Dialog How to change function of second button?
#1

I have set up a dialog box, And i need to either make the function of the second button not matter, Or change the function of it.

How do i do this?
Reply
#2

pawn Код:
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, "Title", "Information", "Button 1", "Button");
OnDialogResponse:

pawn Код:
if(dialogid == dialogid)
{
   if(response == 0)
   {
      Kick(playerid);
   }
   if(response == 1)
   {
      SendClientMessage(playerid, NAME_COLOR, "Thank you for accepting the rules");
   }
}
return 1;
}
Reply
#3

This isnt a messagebox bro is a list, Can you help me out on that?
Reply
#4

pawn Код:
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Title", "Don't accept rules\nAccept Rules", "Proceed", "Cancel");
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == dialogid)
    {
        if(response)
        {
            if(listitem == 0)
            {
                Kick(playerid);
            }
            if(listitem == 1)
            {
                SendClientMessage(playerid, NAME_COLOR, "Thank you for accepting the rules");
            }
            return 1;
        }
    }
return 1;
}
Reply
#5

Example:
OnPlayerConnect:
pawn Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Title", "Information", "Button 1", "Button 2");
OnDialogResponse:
pawn Код:
if(dialogid == 1)
    {
        if(response == 0)
        {
            SendClientMessage(playerid, -1, "You clicked on Button 2");
            //bla bla bla
        }

        if(response)
        {
            if(listitem == 0)
            {
                //bla bla bla
            }
        }
        return 1;
    }
Reply
#6

wholy shit i have been working on that for litteraly hours now thanks so much for ur answers. I really appreciate it i am sleep deprived because of this lol thanks a lot guys ima hit u up when im done with my server so u can come on i wont accept no for an answer lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)