Guest User

Untitled

a guest
Dec 6th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.43 KB | None | 0 0
  1. // Includes
  2. #include <a_samp>
  3.  
  4. // New's
  5. new FightStyle[MAX_PLAYERS];
  6.  
  7. // Defines
  8. #define Fight 0
  9.  
  10. // Colors
  11. #define COLOR_RED 0xFA2B25AA
  12.  
  13. // Forward's
  14. forward LoadFight(playerid);
  15.  
  16. // Publics ;)
  17. public OnPlayerCommandText(playerid, cmdtext[])
  18. {
  19.         if (strcmp("/fight", cmdtext, true, 10) == 0)
  20.         {
  21.                 ShowPlayerDialog(playerid, Fight, DIALOG_STYLE_LIST, "Выберите стиль борьбы:", "Обычный\nБокс\nКик бокс\nЗахваты", "Ok","Выход");
  22.                 SendClientMessage(playerid,0xFF0000AA,"Вы сменили свой стиль боя");
  23.                 return 1;
  24.         }
  25.         return 0;
  26. }
  27.  
  28. public LoadFight(playerid)
  29. {
  30.         if(FightStyle[playerid] == 0)
  31.         {
  32.                 SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL);
  33.         }
  34.  
  35.         if(FightStyle[playerid] == 1)
  36.         {
  37.                 SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
  38.         }
  39.  
  40.         if(FightStyle[playerid] == 2)
  41.         {
  42.                 SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD);
  43.         }
  44.  
  45.         if(FightStyle[playerid] == 3)
  46.         {
  47.                 SetPlayerFightingStyle(playerid, FIGHT_STYLE_GRABKICK);
  48.         }
  49.         return 1;
  50. }
  51.  
  52. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  53. {
  54.         if(dialogid == Fight)
  55.         {
  56.                 if(response)
  57.                 {
  58.                         if(listitem == 0)
  59.                         {
  60.                                 SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL);
  61.                                 FightStyle[playerid] = 0;
  62.                         }
  63.                         if(listitem == 1)
  64.                         {
  65.                                 SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
  66.                                 FightStyle[playerid] = 1;
  67.                         }
  68.                         if(listitem == 2)
  69.                         {
  70.                                 SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD);
  71.                                 FightStyle[playerid] = 2;
  72.                         }
  73.                         if(listitem == 3)
  74.                         {
  75.                                 SetPlayerFightingStyle(playerid, FIGHT_STYLE_GRABKICK);
  76.                                 FightStyle[playerid] = 3;
  77.                         }
  78.                 }
  79.         }
  80.         return 1;
  81. }
Add Comment
Please, Sign In to add comment