How to do it
#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


Messages In This Thread
How to do it - by Karolukas123 - 02.02.2015, 01:03
Re: How to do it - by supernerd2000 - 02.02.2015, 01:09
Re: How to do it - by Karolukas123 - 02.02.2015, 01:17
Re: How to do it - by Abagail - 02.02.2015, 02:10
Re: How to do it - by Karolukas123 - 02.02.2015, 02:30

Forum Jump:


Users browsing this thread: 1 Guest(s)