Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new String[256], SFight[9];
- #define SendFormatMessage(%0,%1,%2,%3) format(String, sizeof(String),%2,%3) && SendClientMessage(%0, %1, String)
- #define Dialog_FightStyle 1
- #define Color_Red 0xFF0000AA
- enum FightInfo
- {
- FightStyle,
- FightName[9]
- };
- new Fight[][FightInfo] =
- {
- {FIGHT_STYLE_NORMAL, "Normal"},
- {FIGHT_STYLE_BOXING, "Boxing"},
- {FIGHT_STYLE_KUNGFU, "Kungfu"},
- {FIGHT_STYLE_KNEEHEAD, "Kneehad"},
- {FIGHT_STYLE_GRABKICK, "Grabkick"},
- {FIGHT_STYLE_ELBOW, "Elbow"}
- };
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext, "/FightStyle", true) == 0 || strcmp(cmdtext, "/FS", true) == 0)
- {
- for(new i, j = sizeof(Fight); i < j; i++) format(SFight, sizeof(SFight), "%s\n", Fight[i][FightName]);
- ShowPlayerDialog(playerid, Dialog_FightStyle, DIALOG_STYLE_LIST, "Change Fight Style", SFight, "Select", "Cancel");
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == Dialog_FightStyle)
- {
- if(!response) return SendClientMessage(playerid, Color_Red, "You have opted to cancel change your fighting style.");
- SetPlayerFightingStyle(playerid, Fight[listitem][FightStyle]);
- SendFormatMessage(playerid, Color_Red, "Your fighting style different style: {FFFF00}%s{FF0000}.", Fight[listitem][FightName]);
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment