22.12.2013, 22:17
go on : onplayercommandtext
for example : we will use command /killmenu ok?
that is with Red is the Command Now :
lets add that menu add :
and the Menu Have 2 Choices : Kill Me and Healme
if you select one and push on YES you make that command if you want Quit Select NO command
Now here is the All command
Now Go On
OnplayerDialogResponse
'(you can search for it with CTRL+F)
and add this
---------------------Hope That Helped and If you need any other help pm me Thanks --------------
Dear.....
don't Feel Like A Noob Because If you asked people and tried to Script So you are a hearo
Mr.kells Thanks
for example : we will use command /killmenu ok?
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/killmenu", cmdtext, true, 10) == 0) {
lets add that menu add :
Код:
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; }
if you select one and push on YES you make that command if you want Quit Select NO command
Now here is the All command
Код:
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; }
OnplayerDialogResponse
'(you can search for it with CTRL+F)
and add this
Код:
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; }
Dear.....
don't Feel Like A Noob Because If you asked people and tried to Script So you are a hearo
Mr.kells Thanks