02.02.2015, 01:03
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
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");
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;
}