#1

hi how to make menu with yes and no
Reply
#2

go on : onplayercommandtext
for example : we will use command /killmenu ok?
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/killmenu", cmdtext, true, 10) == 0)
	{
that is with Red is the Command Now :
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;
}
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
Код:
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;
}
Now Go On
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;
	}
---------------------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
Reply
#3

http://pastebin.com/yN7KLRHf
Reply
#4

Quote:
Originally Posted by HavingGood
Посмотреть сообщение
already gave help -.-
Reply
#5

i'm sorry man but see:

Код:
	if(dialogid == 67)
	{
	if(!response)
	return 1;
	switch(listitem)
The village dances and sings
Reply
#6

lol thanks for correcting
Reply
#7

thanx Kells
Reply
#8

np
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)