29.11.2009, 13:20
Okay, give me a sec. i'll rewrite it for you.
Okay, here you have it:
Put this under public OnPlayerCommandText
And this public OnDialogResponse
UNTESTED
Easy as a pie
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; }
Код:
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; }
Easy as a pie