1
0

fif.pwn 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Fall into Fun Event
  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. #include <YSI\y_hooks>
  34. hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  35. if(arrAntiCheat[playerid][ac_iFlags][AC_DIALOGSPOOFING] > 0) return 1;
  36. switch(dialogid)
  37. {
  38. case DIALOG_FIFMENU:
  39. {
  40. if(!response) return 1;
  41. if(PlayerInfo[playerid][pPR] < 2 && PlayerInfo[playerid][pAdmin] < 1338) return 1;
  42. switch(listitem)
  43. {
  44. case 0:
  45. {
  46. if(FIFEnabled == 0)
  47. {
  48. FIFEnabled = 1;
  49. SendClientMessageEx(playerid, COLOR_WHITE, "You have enabled the Fall Into Fun hours.");
  50. if(IsValidDynamicPickup(FIFPickup)) DestroyDynamicPickup(FIFPickup);
  51. if(IsValidDynamic3DTextLabel(FIFText)) DestroyDynamic3DTextLabel(FIFText);
  52. FIFPickup = CreateDynamicPickup(1239, 23, FIFGamble[0], FIFGamble[1], FIFGamble[2], 0);
  53. FIFText = CreateDynamic3DTextLabel("Chance Gambler\n/gamblechances to risk all of your chances or double them", COLOR_RED, FIFGamble[0], FIFGamble[1], FIFGamble[2]+0.5,10.0);
  54. }
  55. else if(FIFEnabled == 1)
  56. {
  57. FIFEnabled = 0;
  58. SendClientMessageEx(playerid, COLOR_WHITE, "You have disabled the Fall Into Fun hours.");
  59. if(IsValidDynamicPickup(FIFPickup)) DestroyDynamicPickup(FIFPickup);
  60. if(IsValidDynamic3DTextLabel(FIFText)) DestroyDynamic3DTextLabel(FIFText);
  61. }
  62. }
  63. case 1:
  64. {
  65. switch(FIFType)
  66. {
  67. case 1:
  68. {
  69. ShowPlayerDialogEx(playerid, DIALOG_FIFMENU2, DIALOG_STYLE_LIST, "FIF Mode Edit", "{00FF00}Normal Mode (1 chance / 3 hours){FFFFFF}\nDouble Mode (2 chances / 3 hours)\nTriple Mode(3 chances / 3 hours)", "Select", "Cancel");
  70. }
  71. case 2:
  72. {
  73. ShowPlayerDialogEx(playerid, DIALOG_FIFMENU2, DIALOG_STYLE_LIST, "FIF Mode Edit", "Normal Mode (1 chance / 3 hours)\n{00FF00}Double Mode (2 chances / 3 hours){FFFFFF}\nTriple Mode(3 chances / 3 hours)", "Select", "Cancel");
  74. }
  75. case 3:
  76. {
  77. ShowPlayerDialogEx(playerid, DIALOG_FIFMENU2, DIALOG_STYLE_LIST, "FIF Mode Edit", "Normal Mode (1 chance / 3 hours)\nDouble Mode (2 chances / 3 hours)\n{00FF00}Triple Mode(3 chances / 3 hours){FFFFFF}", "Select", "Cancel");
  78. }
  79. }
  80. }
  81. case 2:
  82. {
  83. if(FIFGP3 == 0)
  84. {
  85. FIFGP3 = 1;
  86. SendClientMessageEx(playerid, COLOR_WHITE, "Gold & Platinum VIP x3 Enabled.");
  87. }
  88. else
  89. {
  90. FIFGP3 = 0;
  91. SendClientMessageEx(playerid, COLOR_WHITE, "Gold & Platinum VIP x3 Disabled.");
  92. }
  93. }
  94. case 3:
  95. {
  96. if(FIFTimeWarrior == 0)
  97. {
  98. FIFTimeWarrior = 1;
  99. SendClientMessageEx(playerid, COLOR_WHITE, "Time Warrior Enabled.");
  100. }
  101. else
  102. {
  103. FIFTimeWarrior = 0;
  104. SendClientMessageEx(playerid, COLOR_WHITE, "Time Warrior Disabled.");
  105. }
  106. }
  107. case 4:
  108. {
  109. if(FIFGThurs == 0)
  110. {
  111. FIFGThurs = 1;
  112. SendClientMessageEx(playerid, COLOR_WHITE, "Golden Thursday Enabled.");
  113. }
  114. else
  115. {
  116. FIFGThurs = 0;
  117. SendClientMessageEx(playerid, COLOR_WHITE, "Golden Thursday Disabled.");
  118. }
  119. }
  120. case 5:
  121. {
  122. GetPlayerPos(playerid, FIFGamble[0], FIFGamble[1], FIFGamble[2]);
  123. if(IsValidDynamicPickup(FIFPickup)) DestroyDynamicPickup(FIFPickup);
  124. if(IsValidDynamic3DTextLabel(FIFText)) DestroyDynamic3DTextLabel(FIFText);
  125. FIFPickup = CreateDynamicPickup(1239, 23, FIFGamble[0], FIFGamble[1], FIFGamble[2], -1, -1, -1, 100.0);
  126. FIFText = CreateDynamic3DTextLabel("Chance Gambler\n/gamblechances to risk all of your chances or double them", COLOR_RED, FIFGamble[0], FIFGamble[1], FIFGamble[2]+0.5,10.0);
  127. SendClientMessageEx(playerid, COLOR_WHITE, "FIF Gamble Position Updated");
  128. }
  129. }
  130. Misc_Save();
  131. }
  132. case DIALOG_FIFMENU2:
  133. {
  134. if(!response) return 1;
  135. if(PlayerInfo[playerid][pPR] < 2 && PlayerInfo[playerid][pAdmin] < 1338) return 1;
  136. switch(listitem)
  137. {
  138. case 0:
  139. {
  140. FIFType = 1;
  141. SendClientMessageEx(playerid, COLOR_WHITE, "FIF Mode set to x1");
  142. }
  143. case 1:
  144. {
  145. FIFType = 2;
  146. SendClientMessageEx(playerid, COLOR_WHITE, "FIF Mode set to x2");
  147. }
  148. case 2:
  149. {
  150. FIFType = 3;
  151. SendClientMessageEx(playerid, COLOR_WHITE, "FIF Mode set to x3");
  152. }
  153. }
  154. Misc_Save();
  155. }
  156. }
  157. return 0;
  158. }
  159. #if defined event_chancegambler
  160. CMD:togchancegambler(playerid, params[])
  161. {
  162. if(PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pPR] >= 2)
  163. {
  164. if(chancegambler == 0)
  165. {
  166. chancegambler = 1;
  167. SendClientMessageEx(playerid, COLOR_WHITE, "You have enabled the chance gambler event.");
  168. }
  169. else
  170. {
  171. chancegambler = 0;
  172. SendClientMessageEx(playerid, COLOR_WHITE, "You have disabled the chance gambler event.");
  173. }
  174. }
  175. else return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not authorized to use this command.");
  176. return 1;
  177. }
  178. CMD:gamblechances(playerid, params[])
  179. {
  180. if(FIFEnabled == 1)
  181. {
  182. new iChances = FIFInfo[playerid][FIFChances];
  183. if(iChances < 1)
  184. return SendClientMessageEx(playerid, COLOR_GREY, "You don't have any chances to gamble.");
  185. if(!IsPlayerInRangeOfPoint(playerid, 20, FIFGamble[0], FIFGamble[1], FIFGamble[2]))
  186. return SendClientMessageEx(playerid, COLOR_GREY, "You aren't at the chance gambler location.");
  187. ShowPlayerDialogEx(playerid, DIALOG_ROLL, DIALOG_STYLE_MSGBOX, "Chance Gambler! - All or Nothing","You must roll a number greater than 4 to double your chances.", "Roll", "Cancel");
  188. }
  189. else return 0;
  190. return 1;
  191. }
  192. #endif
  193. CMD:chances(playerid, params[])
  194. {
  195. if(chancegambler == 1)
  196. {
  197. new szMessage[128],
  198. iChances = PlayerInfo[playerid][pRewardDrawChance] / 3;
  199. format(szMessage, sizeof(szMessage), "Chances: %d", iChances);
  200. SendClientMessageEx(playerid, COLOR_CYAN, szMessage);
  201. }
  202. else return 0;
  203. return 1;
  204. }
  205. CMD:fifmenu(playerid, params[])
  206. {
  207. if(PlayerInfo[playerid][pPR] >= 2 || PlayerInfo[playerid][pAdmin] >= 1337)
  208. {
  209. new FIFString[256];
  210. if(FIFEnabled == 0)
  211. {
  212. format(FIFString, sizeof(FIFString), "{00FF00}Enable Fall Into Fun{FFFFFF}\nSet Hour Type");
  213. }
  214. else
  215. {
  216. format(FIFString, sizeof(FIFString), "{B70000}Disable Fall Into Fun{FFFFFF}\nSet Hour Type");
  217. }
  218. if(FIFGP3 == 0)
  219. {
  220. format(FIFString, sizeof(FIFString), "%s\n{00FF00}Enable GVIP & PVIP x3{FFFFFF}", FIFString);
  221. }
  222. else
  223. {
  224. format(FIFString, sizeof(FIFString), "%s\n{B70000}Enable GVIP & PVIP x3{FFFFFF}", FIFString);
  225. }
  226. if(FIFTimeWarrior == 0)
  227. {
  228. format(FIFString, sizeof(FIFString), "%s\n{00FF00}Enable Time Warrior{FFFFFF}", FIFString);
  229. }
  230. else
  231. {
  232. format(FIFString, sizeof(FIFString), "%s\n{B70000}Disable Time Warrior{FFFFFF}", FIFString);
  233. }
  234. if(FIFGThurs == 0)
  235. {
  236. format(FIFString, sizeof(FIFString), "%s\n{00FF00}Enable Golden Thursday{FFFFFF}", FIFString);
  237. }
  238. else
  239. {
  240. format(FIFString, sizeof(FIFString), "%s\n{B70000}Disable Golden Thursday{FFFFFF}", FIFString);
  241. }
  242. format(FIFString,sizeof(FIFString), "%s\nSet Chance Gambler Position", FIFString);
  243. ShowPlayerDialogEx(playerid, DIALOG_FIFMENU, DIALOG_STYLE_LIST, "Fall Into Fun Menu", FIFString, "Select", "Cancel");
  244. }
  245. return 1;
  246. }
  247. CMD:festivalload(playerid, params[]) {
  248. if(PlayerInfo[playerid][pAdmin] < 1338) return 1;
  249. if(!GetGVarType("FallLoaded")) {
  250. SendRconCommand("loadfs FallFestival2014");
  251. SendRconCommand("loadfs FallFestival2014mapping");
  252. SendClientMessageEx(playerid, COLOR_GREY, "Fall Festival Loaded");
  253. SetGVarInt("FallLoaded", 1);
  254. }
  255. else {
  256. SendRconCommand("unloadfs FallFestival2014");
  257. SendRconCommand("unloadfs FallFestival2014mapping");
  258. SendClientMessageEx(playerid, COLOR_GREY, "Fall Festival unloaded");
  259. DeleteGVar("FallLoaded");
  260. }
  261. return 1;
  262. }