SA-MP Forums Archive
help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help (/showthread.php?tid=482787)



help - moustafa0550 - 22.12.2013

hi how to make menu with yes and no


Re: help - Kells - 22.12.2013

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


Re: help - HavingGood - 22.12.2013

http://pastebin.com/yN7KLRHf


Re: help - Kells - 22.12.2013

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


Re: help - HavingGood - 22.12.2013

i'm sorry man but see:

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


Re: help - Kells - 22.12.2013

lol thanks for correcting


Re: help - moustafa0550 - 23.12.2013

thanx Kells


Re: help - Kells - 23.12.2013

np