1
0

fishingsystem.pwn 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Fishing Job System
  11. Next Generation Gaming, LLC
  12. (created by Next Generation Gaming Development Team)
  13. * Copyright (c) 2014, 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. // WINTERFIELD: VERSION .278 FISHING SYSTEM
  34. #include <YSI\y_hooks>
  35. hook OnPlayerEnterCheckpoint(playerid) {
  36. if(GetPVarInt(playerid, "pSellingFish"))
  37. {
  38. DisablePlayerCheckpoint(playerid);
  39. DeletePVar(playerid, "pSellingFish");
  40. SendClientMessageEx(playerid, COLOR_WHITE, "You have reached your destination. Type /sellfish [amount] to sell your fish.");
  41. }
  42. return 1;
  43. }
  44. IncreaseFishingLevel(playerid) {
  45. if(PlayerInfo[playerid][pDoubleEXP] > 0)
  46. {
  47. PlayerInfo[playerid][pFishingSkill] += 2;
  48. format(szMiscArray, sizeof(szMiscArray), "You have gained 2 fishing skill points instead of 1. You have %d hours left on the Double EXP token.", PlayerInfo[playerid][pDoubleEXP]);
  49. SendClientMessageEx(playerid, COLOR_YELLOW, szMiscArray);
  50. // PlayerInfo[playerid][pXP] += PlayerInfo[playerid][pLevel] * XP_RATE * 2;
  51. }
  52. else
  53. {
  54. PlayerInfo[playerid][pFishingSkill] += 1;
  55. // PlayerInfo[playerid][pXP] += PlayerInfo[playerid][pLevel] * XP_RATE;
  56. }
  57. return 1;
  58. }
  59. CMD:fishhelp(playerid, params[])
  60. {
  61. SetPVarInt(playerid, "HelpResultCat0", 5);
  62. Help_ListCat(playerid, DIALOG_HELPCATOTHER1);
  63. return 1;
  64. }
  65. CMD:ofishhelp(playerid, params[])
  66. {
  67. SendClientMessageEx(playerid, COLOR_GREEN,"_______________________________________");
  68. SendClientMessageEx(playerid, COLOR_WHITE,"*** FISH HELP *** - type a command for more infomation.");
  69. SendClientMessageEx(playerid, COLOR_GRAD3,"*** FISHING *** /fish (Try to catch a fish) /myfish (Show the fishes you have caught)");
  70. SendClientMessageEx(playerid, COLOR_GRAD3,"*** FISHING *** /sellfish (Sell your fish)");
  71. return 1;
  72. }
  73. CMD:fish(playerid, params[]) {
  74. //if(PlayerInfo[playerid][pJob] == 70 || PlayerInfo[playerid][pJob2] == 70 || PlayerInfo[playerid][pJob3] == 70)
  75. {
  76. if(IsABoat(GetPlayerVehicleID(playerid)))
  77. {
  78. {
  79. if(PlayerInfo[playerid][pFishWeight] <= 1000)
  80. {
  81. if(GetPVarInt(playerid, "pFishTime") < gettime())
  82. {
  83. switch(PlayerInfo[playerid][pFishingSkill])
  84. {
  85. case 0 .. 49:
  86. {
  87. switch(random(2))
  88. {
  89. case 0:
  90. {
  91. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  92. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  93. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  94. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught nothing!");
  95. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  96. IncreaseFishingLevel(playerid);
  97. }
  98. case 1:
  99. {
  100. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  101. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  102. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  103. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a bluegill!");
  104. PlayerInfo[playerid][pFishWeight] += 5;
  105. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  106. IncreaseFishingLevel(playerid);
  107. }
  108. case 2:
  109. {
  110. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  111. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  112. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  113. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a bass!");
  114. PlayerInfo[playerid][pFishWeight] += 7;
  115. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  116. IncreaseFishingLevel(playerid);
  117. }
  118. }
  119. }
  120. case 50 .. 99:
  121. {
  122. switch(random(4))
  123. {
  124. case 0:
  125. {
  126. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  127. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  128. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  129. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught nothing!");
  130. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  131. IncreaseFishingLevel(playerid);
  132. }
  133. case 1:
  134. {
  135. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  136. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  137. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  138. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a bluegill!");
  139. PlayerInfo[playerid][pFishWeight] += 5;
  140. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  141. IncreaseFishingLevel(playerid);
  142. }
  143. case 2:
  144. {
  145. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  146. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  147. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  148. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a bass!");
  149. PlayerInfo[playerid][pFishWeight] += 7;
  150. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  151. IncreaseFishingLevel(playerid);
  152. }
  153. case 3:
  154. {
  155. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  156. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  157. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  158. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a cod!");
  159. PlayerInfo[playerid][pFishWeight] += 14;
  160. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  161. IncreaseFishingLevel(playerid);
  162. }
  163. case 4:
  164. {
  165. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  166. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  167. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  168. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a catfish!");
  169. PlayerInfo[playerid][pFishWeight] += 17;
  170. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  171. IncreaseFishingLevel(playerid);
  172. }
  173. }
  174. }
  175. case 100 .. 199:
  176. {
  177. switch(random(8))
  178. {
  179. case 0:
  180. {
  181. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  182. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  183. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  184. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught nothing!");
  185. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  186. IncreaseFishingLevel(playerid);
  187. }
  188. case 1:
  189. {
  190. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  191. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  192. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  193. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a bluegill!");
  194. PlayerInfo[playerid][pFishWeight] += 5;
  195. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  196. IncreaseFishingLevel(playerid);
  197. }
  198. case 2:
  199. {
  200. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  201. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  202. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  203. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a bass!");
  204. PlayerInfo[playerid][pFishWeight] += 7;
  205. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  206. IncreaseFishingLevel(playerid);
  207. }
  208. case 3:
  209. {
  210. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  211. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  212. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  213. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a cod!");
  214. PlayerInfo[playerid][pFishWeight] += 14;
  215. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  216. IncreaseFishingLevel(playerid);
  217. }
  218. case 4:
  219. {
  220. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  221. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  222. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  223. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a catfish!");
  224. PlayerInfo[playerid][pFishWeight] += 17;
  225. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  226. IncreaseFishingLevel(playerid);
  227. }
  228. case 5:
  229. {
  230. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  231. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  232. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  233. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a pike!");
  234. PlayerInfo[playerid][pFishWeight] += 24;
  235. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  236. IncreaseFishingLevel(playerid);
  237. }
  238. case 6:
  239. {
  240. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  241. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  242. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  243. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a zander!");
  244. PlayerInfo[playerid][pFishWeight] += 30;
  245. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  246. IncreaseFishingLevel(playerid);
  247. }
  248. case 7:
  249. {
  250. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  251. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  252. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  253. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a mackerel!");
  254. PlayerInfo[playerid][pFishWeight] += 35;
  255. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  256. IncreaseFishingLevel(playerid);
  257. }
  258. case 8:
  259. {
  260. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  261. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  262. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  263. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a molly!");
  264. PlayerInfo[playerid][pFishWeight] += 40;
  265. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  266. IncreaseFishingLevel(playerid);
  267. }
  268. }
  269. }
  270. case 200 .. 399:
  271. {
  272. switch(random(11))
  273. {
  274. case 0:
  275. {
  276. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  277. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  278. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  279. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught nothing!");
  280. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  281. IncreaseFishingLevel(playerid);
  282. }
  283. case 1:
  284. {
  285. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  286. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  287. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  288. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a bluegill!");
  289. PlayerInfo[playerid][pFishWeight] += 5;
  290. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  291. IncreaseFishingLevel(playerid);
  292. }
  293. case 2:
  294. {
  295. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  296. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  297. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  298. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a bass!");
  299. PlayerInfo[playerid][pFishWeight] += 7;
  300. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  301. IncreaseFishingLevel(playerid);
  302. }
  303. case 3:
  304. {
  305. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  306. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  307. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  308. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a cod!");
  309. PlayerInfo[playerid][pFishWeight] += 14;
  310. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  311. IncreaseFishingLevel(playerid);
  312. }
  313. case 4:
  314. {
  315. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  316. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  317. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  318. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a catfish!");
  319. PlayerInfo[playerid][pFishWeight] += 17;
  320. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  321. IncreaseFishingLevel(playerid);
  322. }
  323. case 5:
  324. {
  325. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  326. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  327. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  328. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a pike!");
  329. PlayerInfo[playerid][pFishWeight] += 24;
  330. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  331. IncreaseFishingLevel(playerid);
  332. }
  333. case 6:
  334. {
  335. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  336. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  337. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  338. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a zander!");
  339. PlayerInfo[playerid][pFishWeight] += 30;
  340. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  341. IncreaseFishingLevel(playerid);
  342. }
  343. case 7:
  344. {
  345. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  346. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  347. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  348. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a mackerel!");
  349. PlayerInfo[playerid][pFishWeight] += 35;
  350. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  351. IncreaseFishingLevel(playerid);
  352. }
  353. case 8:
  354. {
  355. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  356. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  357. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  358. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a molly!");
  359. PlayerInfo[playerid][pFishWeight] += 40;
  360. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  361. IncreaseFishingLevel(playerid);
  362. }
  363. case 9:
  364. {
  365. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  366. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  367. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  368. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a swordfish!");
  369. PlayerInfo[playerid][pFishWeight] += 70;
  370. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  371. IncreaseFishingLevel(playerid);
  372. }
  373. case 10:
  374. {
  375. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  376. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  377. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  378. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a tench!");
  379. PlayerInfo[playerid][pFishWeight] += 71;
  380. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  381. IncreaseFishingLevel(playerid);
  382. }
  383. case 11:
  384. {
  385. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  386. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  387. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  388. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a seabass!");
  389. PlayerInfo[playerid][pFishWeight] += 80;
  390. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  391. IncreaseFishingLevel(playerid);
  392. }
  393. }
  394. }
  395. default:
  396. {
  397. switch(random(12))
  398. {
  399. case 0:
  400. {
  401. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  402. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  403. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  404. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught nothing!");
  405. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  406. IncreaseFishingLevel(playerid);
  407. }
  408. case 1:
  409. {
  410. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  411. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  412. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  413. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a bluegill!");
  414. PlayerInfo[playerid][pFishWeight] += 5;
  415. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  416. IncreaseFishingLevel(playerid);
  417. }
  418. case 2:
  419. {
  420. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  421. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  422. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  423. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a bass!");
  424. PlayerInfo[playerid][pFishWeight] += 7;
  425. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  426. IncreaseFishingLevel(playerid);
  427. }
  428. case 3:
  429. {
  430. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  431. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  432. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  433. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a cod!");
  434. PlayerInfo[playerid][pFishWeight] += 14;
  435. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  436. IncreaseFishingLevel(playerid);
  437. }
  438. case 4:
  439. {
  440. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  441. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  442. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  443. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a catfish!");
  444. PlayerInfo[playerid][pFishWeight] += 17;
  445. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  446. IncreaseFishingLevel(playerid);
  447. }
  448. case 5:
  449. {
  450. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  451. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  452. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  453. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a pike!");
  454. PlayerInfo[playerid][pFishWeight] += 24;
  455. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  456. IncreaseFishingLevel(playerid);
  457. }
  458. case 6:
  459. {
  460. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  461. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  462. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  463. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a zander!");
  464. PlayerInfo[playerid][pFishWeight] += 30;
  465. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  466. IncreaseFishingLevel(playerid);
  467. }
  468. case 7:
  469. {
  470. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  471. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  472. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  473. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a mackerel!");
  474. PlayerInfo[playerid][pFishWeight] += 35;
  475. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  476. IncreaseFishingLevel(playerid);
  477. }
  478. case 8:
  479. {
  480. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  481. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  482. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  483. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a molly!");
  484. PlayerInfo[playerid][pFishWeight] += 40;
  485. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  486. IncreaseFishingLevel(playerid);
  487. }
  488. case 9:
  489. {
  490. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  491. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  492. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  493. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a swordfish!");
  494. PlayerInfo[playerid][pFishWeight] += 70;
  495. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  496. IncreaseFishingLevel(playerid);
  497. }
  498. case 10:
  499. {
  500. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  501. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  502. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  503. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a tench!");
  504. PlayerInfo[playerid][pFishWeight] += 71;
  505. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  506. IncreaseFishingLevel(playerid);
  507. }
  508. case 11:
  509. {
  510. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  511. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  512. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  513. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a seabass!");
  514. PlayerInfo[playerid][pFishWeight] += 80;
  515. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  516. IncreaseFishingLevel(playerid);
  517. }
  518. case 12:
  519. {
  520. format(szMiscArray, sizeof szMiscArray, "{FF8000}* {C2A2DA}%s casts their rod out, reeling it back in.", GetPlayerNameEx(playerid));
  521. SetPlayerChatBubble(playerid, szMiscArray, COLOR_PURPLE, 30.0, 4000);
  522. SendClientMessageEx(playerid, COLOR_PURPLE, szMiscArray);
  523. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You have caught a kraken!");
  524. PlayerInfo[playerid][pFishWeight] += 200;
  525. SetPVarInt(playerid, "pFishTime", gettime() + 10);
  526. IncreaseFishingLevel(playerid);
  527. }
  528. }
  529. }
  530. }
  531. }
  532. else SendClientMessageEx(playerid, COLOR_GRAD2, " You must wait 10 more seconds before you can cast out again!");
  533. }
  534. else SendClientMessageEx(playerid, COLOR_GRAD2, " You have reached your maximum weight. Type /sellfish to profit.");
  535. }
  536. }
  537. else return SendClientMessageEx(playerid, COLOR_GRAD2, " You are not in a boat!");
  538. }
  539. //else SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a fisherman!");
  540. return 1;
  541. }
  542. CMD:myfish(playerid, params[]) {
  543. format(szMiscArray, sizeof(szMiscArray), "Fish: %d lbs.", PlayerInfo[playerid][pFishWeight]);
  544. SendClientMessageEx(playerid, COLOR_YELLOW, szMiscArray);
  545. return 1;
  546. }
  547. CMD:sellfish(playerid, params[]) {
  548. new amount;
  549. if(GetPVarInt(playerid, "pFishSellTime") < gettime())
  550. {
  551. if(PlayerInfo[playerid][pFishWeight] < 50) return SendClientMessageEx(playerid, COLOR_GREY, "You must at least have fifty pounds of fish to sell them.");
  552. if(IsPlayerInRangeOfPoint(playerid, 30.0, 2161.0513,-98.5897,2.7893))
  553. {
  554. if(sscanf(params, "d", amount))
  555. {
  556. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /sellfish [amount]");
  557. format(szMiscArray, sizeof szMiscArray, "Fish: %d lbs.", PlayerInfo[playerid][pFishWeight]);
  558. return SendClientMessageEx(playerid, COLOR_YELLOW, szMiscArray);
  559. }
  560. if(amount < 50) return SendClientMessageEx(playerid, COLOR_GREY, "You can only sell over 50 pounds of fish at a time.");
  561. if(PlayerInfo[playerid][pFishWeight] >= amount && PlayerInfo[playerid][pFishWeight] != 0)
  562. {
  563. new rand = random(100) + 100, money = amount * 40 + rand;
  564. PlayerInfo[playerid][pFishWeight] -= amount;
  565. GivePlayerCash(playerid, money);
  566. SetPVarInt(playerid, "pFishSellTime", gettime() + 120);
  567. format(szMiscArray, sizeof szMiscArray, "You have sold %d lbs for $%s.", amount, number_format(money));
  568. SendClientMessageEx(playerid, COLOR_YELLOW, szMiscArray);
  569. }
  570. else return SendClientMessageEx(playerid, COLOR_GRAD2, " You don't have that many pounds!");
  571. }
  572. else
  573. {
  574. if(CheckPointCheck(playerid)) cmd_killcheckpoint(playerid, params);
  575. GameTextForPlayer(playerid, "~g~CHECKPOINT ~r~SET", 5000, 4);
  576. SetPVarInt(playerid, "pSellingFish", 1);
  577. SetPlayerCheckpoint(playerid, 2161.0513,-98.5897,2.7893, 10.0);
  578. return SendClientMessageEx(playerid, COLOR_YELLOW, "Make your way to the checkpoint to sell your fish.");
  579. }
  580. }
  581. else SendClientMessageEx(playerid, COLOR_GRAD2, " You must wait two minutes before selling your fish again!");
  582. return 1;
  583. }