_iLustcheR_

SAMP-IL Array FightStyle System v1.0 by _iLustcheR_

May 4th, 2014
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.46 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new String[256], SFight[9];
  4. #define SendFormatMessage(%0,%1,%2,%3) format(String, sizeof(String),%2,%3) && SendClientMessage(%0, %1, String)
  5.  
  6. #define Dialog_FightStyle 1
  7.  
  8. #define Color_Red  0xFF0000AA
  9.  
  10. enum FightInfo
  11. {
  12.     FightStyle,
  13.     FightName[9]
  14. };
  15. new Fight[][FightInfo] =
  16. {
  17.     {FIGHT_STYLE_NORMAL,   "Normal"},
  18.     {FIGHT_STYLE_BOXING,   "Boxing"},
  19.     {FIGHT_STYLE_KUNGFU,   "Kungfu"},
  20.     {FIGHT_STYLE_KNEEHEAD, "Kneehad"},
  21.     {FIGHT_STYLE_GRABKICK, "Grabkick"},
  22.     {FIGHT_STYLE_ELBOW,    "Elbow"}
  23. };
  24.  
  25. public OnPlayerCommandText(playerid, cmdtext[])
  26. {
  27.     if(strcmp(cmdtext, "/FightStyle", true) == 0 || strcmp(cmdtext, "/FS", true) == 0)
  28.     {
  29.         for(new i, j = sizeof(Fight); i < j; i++) format(SFight, sizeof(SFight), "%s\n", Fight[i][FightName]);
  30.         ShowPlayerDialog(playerid, Dialog_FightStyle, DIALOG_STYLE_LIST, "Change Fight Style", SFight, "Select", "Cancel");
  31.         return 1;
  32.     }
  33.     return 0;
  34. }
  35.  
  36. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  37. {
  38.     if(dialogid == Dialog_FightStyle)
  39.     {
  40.         if(!response) return SendClientMessage(playerid, Color_Red, "You have opted to cancel change your fighting style.");
  41.         SetPlayerFightingStyle(playerid, Fight[listitem][FightStyle]);
  42.         SendFormatMessage(playerid, Color_Red, "Your fighting style different style: {FFFF00}%s{FF0000}.", Fight[listitem][FightName]);
  43.         return 1;
  44.     }
  45.     return 1;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment