boxing.pwn 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Boxing System
  11. Next Generation Gaming, LLC
  12. (created by Next Generation Gaming Development Team)
  13. * Copyright (c) 2016, Next Generation Gaming, LLC
  14. *
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without modification,
  18. * are not permitted in any case.
  19. *
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. /*CMD:setchamp(playerid, params[])
  34. {
  35. if(PlayerInfo[playerid][pAdmin] >= 4)
  36. {
  37. new string[128], giveplayerid;
  38. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /setchamp [player]");
  39. if(IsPlayerConnected(giveplayerid))
  40. {
  41. new giveplayer[MAX_PLAYER_NAME];
  42. GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  43. new nstring[MAX_PLAYER_NAME];
  44. format(nstring, sizeof(nstring), "%s", giveplayer);
  45. strmid(Titel[TitelName], nstring, 0, strlen(nstring), 255);
  46. Titel[TitelWins] = PlayerInfo[giveplayerid][pWins];
  47. Titel[TitelLoses] = PlayerInfo[giveplayerid][pLoses];
  48. Misc_Save();
  49. format(string, sizeof(string), "* You have made %s the new Boxing Champion.", giveplayer);
  50. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  51. }
  52. else
  53. {
  54. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  55. return 1;
  56. }
  57. }
  58. else
  59. {
  60. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  61. }
  62. return 1;
  63. }*/
  64. CMD:boxstats(playerid, params[])
  65. {
  66. if(PlayerInfo[playerid][pJob] != 12 && PlayerInfo[playerid][pJob2] != 12 && PlayerInfo[playerid][pJob3] != 12)
  67. {
  68. SendClientMessageEx(playerid, COLOR_GREY, " You are not a Boxer!");
  69. return 1;
  70. }
  71. new string[128], ttext[20];//Title
  72. new clevel = PlayerInfo[playerid][pBoxSkill];
  73. if(clevel >= 0 && clevel <= 50) { ttext = "Beginner"; }
  74. else if(clevel >= 51 && clevel <= 200) { ttext = "Amateur"; }
  75. else if(clevel >= 201 && clevel <= 400) { ttext = "Professional"; }
  76. new ntext[20];//NickName
  77. new level = PlayerInfo[playerid][pWins];
  78. if(level > 0 && PlayerInfo[playerid][pLoses] == 0)
  79. {
  80. ntext = "Undefeated";
  81. }
  82. else
  83. {
  84. if(level >= 0 && level <= 10) { ntext = "Newcomer"; }
  85. else if(level >= 11 && level <= 20) { ntext = "Touchy Fist"; }
  86. else if(level >= 21 && level <= 30) { ntext = "Nut Cracker"; }
  87. else if(level >= 31 && level <= 40) { ntext = "Tommygun"; }
  88. else if(level >= 41 && level <= 50) { ntext = "Skull Breaker"; }
  89. else if(level >= 51 && level <= 60) { ntext = "Light Speed"; }
  90. else if(level >= 61 && level <= 70) { ntext = "Unbroken Warrior"; }
  91. else if(level >= 71) { ntext = "Itallion Stallion"; }
  92. }
  93. SendClientMessageEx(playerid, COLOR_WHITE, "|__________________ Boxing Records __________________|");
  94. format(string, sizeof(string), "| Current Champion: %s, with [%d] Winnings and [%d] Losses.", Titel[TitelName],Titel[TitelWins],Titel[TitelLoses]);
  95. SendClientMessageEx(playerid, COLOR_GREY, string);
  96. format(string, sizeof(string), "| Current Title: %s.", ttext);
  97. SendClientMessageEx(playerid, COLOR_GREY, string);
  98. format(string, sizeof(string), "| Current NickName: %s.", ntext);
  99. SendClientMessageEx(playerid, COLOR_GREY, string);
  100. format(string, sizeof(string), "| Total Wins: %d.", PlayerInfo[playerid][pWins]);
  101. SendClientMessageEx(playerid, COLOR_GREY, string);
  102. format(string, sizeof(string), "| Total Losses: %d.", PlayerInfo[playerid][pLoses]);
  103. SendClientMessageEx(playerid, COLOR_GREY, string);
  104. SendClientMessageEx(playerid, COLOR_WHITE, "|____________________________________________________|");
  105. return 1;
  106. }
  107. CMD:train(playerid, params[])
  108. {
  109. if(IsPlayerInRangeOfPoint(playerid, 3.0, 757.3734,5.7227,1000.7012) || IsPlayerInRangeOfPoint(playerid, 3.0, 758.43,-78.0,1000.65) || IsPlayerInRangeOfPoint(playerid, 3.0, 2903.371826, -2254.517333, 7.244657))
  110. {
  111. if(PlayerInfo[playerid][pDonateRank] >= 1)
  112. {
  113. ShowPlayerDialogEx(playerid, FIGHTMENU, DIALOG_STYLE_LIST, "Fighting Moves", "Boxing $40000\nElbow $40000\nKneehead $40000\nKung-Fu $40000\nGrabKick $40000\nNormal", "Learn", "Cancel");
  114. }
  115. else
  116. {
  117. ShowPlayerDialogEx(playerid, FIGHTMENU, DIALOG_STYLE_LIST, "Fighting Moves", "Boxing $50000\nElbow $50000\nKneehead $50000\nKung-Fu $50000\nGrabKick $50000\nNormal", "Learn", "Cancel");
  118. }
  119. }
  120. else
  121. {
  122. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not at the learning area! (Inside gym)");
  123. }
  124. return 1;
  125. }
  126. CMD:fight(playerid, params[])
  127. {
  128. if(PlayerInfo[playerid][pJob] != 12 && PlayerInfo[playerid][pJob2] != 12 && PlayerInfo[playerid][pJob3] != 12)
  129. {
  130. SendClientMessageEx(playerid, COLOR_GREY, " You are not a Boxer!");
  131. return 1;
  132. }
  133. if(InRing > 0)
  134. {
  135. SendClientMessageEx(playerid, COLOR_GREY, " There is already a Fight going on, wait for it to Finish!");
  136. return 1;
  137. }
  138. if(PlayerBoxing[playerid] > 0)
  139. {
  140. SendClientMessageEx(playerid, COLOR_GREY, " You are already Fighting!");
  141. return 1;
  142. }
  143. new string[128], giveplayerid;
  144. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /fight [player]");
  145. if(IsPlayerConnected(giveplayerid))
  146. {
  147. if (ProxDetectorS(8.0, playerid, giveplayerid))
  148. {
  149. if(IsPlayerInRangeOfPoint(playerid,20.0,765.9343,0.2761,1000.7173) || IsPlayerInRangeOfPoint(playerid,20.0,768.48, -73.66, 1000.57))
  150. {
  151. if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot Box with yourself!"); return 1; }
  152. format(string, sizeof(string), "* You offered a Boxing Challenge to %s.", GetPlayerNameEx(giveplayerid));
  153. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  154. format(string, sizeof(string), "* Boxer %s wants to Fight with you (type /accept boxing) to accept.", GetPlayerNameEx(playerid));
  155. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  156. BoxOffer[giveplayerid] = playerid;
  157. }
  158. else
  159. {
  160. SendClientMessageEx(playerid, COLOR_GRAD2," You are not at the Gym!");
  161. return 1;
  162. }
  163. }
  164. else
  165. {
  166. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  167. return 1;
  168. }
  169. }
  170. else
  171. {
  172. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  173. return 1;
  174. }
  175. return 1;
  176. }