22.12.2013, 21:48
hi how to make menu with yes and no
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/killmenu", cmdtext, true, 10) == 0) {
ShowPlayerDialog(playerid,99,DIALOG_STYLE_LIST,"{00FF00}Kill Menu","\n{FFFFFF}Kill Me {00FF00}3000$\n{FFFFFF}heal me- {00FF00}7800$","Buy (YES)","Cancel(NO)"); // this will show A box and choices return 1; } return 0; }
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/killmenu", cmdtext, true, 10) == 0) { ShowPlayerDialog(playerid,99,DIALOG_STYLE_LIST,"{00FF00}Kill Menu","\n{FFFFFF}Kill Me {00FF00}3000$\n{FFFFFF}heal me- {00FF00}7800$","Buy (YES)","Cancel(NO)"); // this will show A box and choices return 1; } return 0; }
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) // { if(dialogid == 67) { if(!response) return 1; switch(listitem) { case 0: { if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, 0x9EC73DAA, "You don't have enough cash to use this"); GivePlayerMoney(playerid, -100); SetPlayerHealth(playerid,0); SendClientMessage(playerid, 0x2641FEAA, "You Are killed"); } //case 1 if you want to heal your self case 1: { if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, 0x9EC73DAA, "You don't have enough cash to use this."); GivePlayerMoney(playerid, -100); SetPlayerHealth(playerid,0); SendClientMessage(playerid, 0x2641FEAA, "You Have Been Healed"); } } } return 1; }
if(dialogid == 67) { if(!response) return 1; switch(listitem)