Dialog help
#8

Okay, give me a sec. i'll rewrite it for you.


Okay, here you have it:

Put this under public OnPlayerCommandText
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/fightstyle", cmdtext, true, 11) == 0)
	{
		ShowPlayerDialog(playerid, 1234, DIALOG_STYLE_LIST, "Fighting Style", "Elbow\nBoxing\nGrabkick\nKneehead\nKungfu\nNormal", "Learn", "Cancel");
		return 1;
	}
	return 0;
}
And this public OnDialogResponse
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 1234)
	{
	  if(response)
	  {
	    if(listitem == 0)
	    {
	      SetPlayerFightingStyle(playerid, FIGHT_STYLE_ELBOW);
				SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'Elbow'");
			}
			if(listitem == 1)
			{
			  SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
			  SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'Boxing'");
			}
			if(listitem == 2)
			{
			  SetPlayerFightingStyle(playerid, FIGHT_STYLE_GRABKICK);
			  SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'Grabkick'");
			}
			if(listitem == 3)
			{
			  SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD);
			  SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'KNEEHEAD'");
			}
			if(listitem == 4)
			{
			  SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU);
			  SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'KUNGFU'");
			}
			if(listitem == 5)
			{
			  SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL);
			  SendClientMessage(playerid, 0xFFFFFFFF, "You've learned fighting style 'Normal'");
			}
		}
	}
	return 1;
}
UNTESTED

Easy as a pie
Reply


Messages In This Thread
Dialog help - by WardenCS - 29.11.2009, 12:19
Re: Dialog help - by Niixie - 29.11.2009, 12:30
Re: Dialog help - by WardenCS - 29.11.2009, 12:34
Re: Dialog help - by Niixie - 29.11.2009, 12:35
Re: Dialog help - by WardenCS - 29.11.2009, 12:39
Re: Dialog help - by Niixie - 29.11.2009, 12:41
Re: Dialog help - by WardenCS - 29.11.2009, 12:44
Re: Dialog help - by Niixie - 29.11.2009, 13:20
Re: Dialog help - by WardenCS - 29.11.2009, 13:45
Re: Dialog help - by [NYRP]Mike. - 29.11.2009, 13:56

Forum Jump:


Users browsing this thread: 2 Guest(s)