How to do it
#1

Hello, how to make it through DIALOG_STYLE_LIST clicking on the same each time you start the selection function and clicking on the next generation of the same off
Reply
#2

You need to explain in more detail what you are looking for.

From what I can understand:
You want it so that whenever someone selects something in a dialog, it opens a different dialog?
Reply
#3

No No, I need that selected the same line, it would act as switching on and off
Reply
#4

You mean like this?

pawn Код:
new string[32], switchstr[5];
switch(g_Variable)
{
    case 0: format(switchstr, sizeof(switchstr), "Off");
    default: format(switchstr, sizeof(switchstr), "On");
}
format(string, sizeof(string), "Toggle %s", switchstr);
ShowPlayerDialog(playerid, DIALOG_ONOFF, DIALOG_STYLE_MSGBOX, "Toggle", string, "Yes", "Cancel");
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
     if(!response) return 1;
     if(dialogid == DIALOG_ONOFF)
     {
          if(g_Variable)
          {
               g_Variable = 0;
               SendClientMessage(playerid, -1, "variable set to 0");
          }
          else
          {
               g_Variable = 1;
               SendClientMessage(playerid, -1, "variable set to 1");
          }
     }
return 1;
}
Reply
#5

Yes, thanks
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)