04.01.2010, 06:25
Hello there,
I want to make such a GUI that if you press Cancel, it says ''Invalid selection, please choose one and press OK'' and returns you to the GUI list back. Is that possible? This is my code...
I want to make such a GUI that if you press Cancel, it says ''Invalid selection, please choose one and press OK'' and returns you to the GUI list back. Is that possible? This is my code...
Код:
public OnPlayerSpawn(playerid) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Choose your spawn place...", "Blueberry\nFort Carson\nMontgomery\nPalomino Creek\nDillimore\nHampton Barns", "OK", "Cancel"); return 1; }
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (dialogid == 1) { if (response == 1) { switch (listitem) { case 0:SetPlayerPos(playerid, ...); case 1:SetPlayerPos(playerid, ...); case 2:SetPlayerPos(playerid, ...); case 3:SetPlayerPos(playerid, ...); case 4:SetPlayerPos(playerid, ...); case 5:SetPlayerPos(playerid, ...); } SendClientMessage(playerid, 0xFFFFFFFF, "You have been spawned at the place of your choice!"); } else { SendClientMessage(playerid, 0xFFFFFFFF, "Invalid selection, please choose one and press OK to continue."); } return 1; } return 0; }