1
0

fishing.pwn 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Fishing 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. stock IsAtFishPlace(playerid)
  34. {
  35. if(IsPlayerConnected(playerid))
  36. {
  37. if(IsPlayerInRangeOfPoint(playerid,1.0,403.8266,-2088.7598,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,398.7553,-2088.7490,7.8359))
  38. {//Fishplace at the bigwheel
  39. return 1;
  40. }
  41. else if(IsPlayerInRangeOfPoint(playerid,1.0,396.2197,-2088.6692,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,391.1094,-2088.7976,7.8359))
  42. {//Fishplace at the bigwheel
  43. return 1;
  44. }
  45. else if(IsPlayerInRangeOfPoint(playerid,1.0,383.4157,-2088.7849,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,374.9598,-2088.7979,7.8359))
  46. {//Fishplace at the bigwheel
  47. return 1;
  48. }
  49. else if(IsPlayerInRangeOfPoint(playerid,1.0,369.8107,-2088.7927,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,367.3637,-2088.7925,7.8359))
  50. {//Fishplace at the bigwheel
  51. return 1;
  52. }
  53. else if(IsPlayerInRangeOfPoint(playerid,1.0,362.2244,-2088.7981,7.8359) || IsPlayerInRangeOfPoint(playerid,1.0,354.5382,-2088.7979,7.8359))
  54. {//Fishplace at the bigwheel
  55. return 1;
  56. }
  57. }
  58. return 0;
  59. }
  60. stock FishCost(playerid, fish)
  61. {
  62. if(IsPlayerConnected(playerid)) {
  63. new cost = 0;
  64. switch (fish)
  65. {
  66. case 1:
  67. {
  68. cost = 1;
  69. }
  70. case 2:
  71. {
  72. cost = 3;
  73. }
  74. case 3:
  75. {
  76. cost = 3;
  77. }
  78. case 5:
  79. {
  80. cost = 5;
  81. }
  82. case 6:
  83. {
  84. cost = 2;
  85. }
  86. case 8:
  87. {
  88. cost = 8;
  89. }
  90. case 9:
  91. {
  92. cost = 12;
  93. }
  94. case 11:
  95. {
  96. cost = 9;
  97. }
  98. case 12:
  99. {
  100. cost = 7;
  101. }
  102. case 14:
  103. {
  104. cost = 12;
  105. }
  106. case 15:
  107. {
  108. cost = 9;
  109. }
  110. case 16:
  111. {
  112. cost = 7;
  113. }
  114. case 17:
  115. {
  116. cost = 7;
  117. }
  118. case 18:
  119. {
  120. cost = 10;
  121. }
  122. case 19:
  123. {
  124. cost = 4;
  125. }
  126. case 21:
  127. {
  128. cost = 3;
  129. }
  130. }
  131. return cost;
  132. }
  133. return 0;
  134. }
  135. stock ClearFishes(playerid)
  136. {
  137. if(IsPlayerConnected(playerid)) {
  138. Fishes[playerid][pFid1] = 0; Fishes[playerid][pFid2] = 0; Fishes[playerid][pFid3] = 0;
  139. Fishes[playerid][pFid4] = 0; Fishes[playerid][pFid5] = 0;
  140. Fishes[playerid][pWeight1] = 0; Fishes[playerid][pWeight2] = 0; Fishes[playerid][pWeight3] = 0;
  141. Fishes[playerid][pWeight4] = 0; Fishes[playerid][pWeight5] = 0;
  142. new string[MAX_PLAYER_NAME];
  143. format(string, sizeof(string), "None");
  144. strmid(Fishes[playerid][pFish1], string, 0, strlen(string), 255);
  145. strmid(Fishes[playerid][pFish2], string, 0, strlen(string), 255);
  146. strmid(Fishes[playerid][pFish3], string, 0, strlen(string), 255);
  147. strmid(Fishes[playerid][pFish4], string, 0, strlen(string), 255);
  148. strmid(Fishes[playerid][pFish5], string, 0, strlen(string), 255);
  149. }
  150. return 1;
  151. }
  152. stock ClearFishID(playerid, fish)
  153. {
  154. if(IsPlayerConnected(playerid))
  155. {
  156. new string[MAX_PLAYER_NAME];
  157. format(string, sizeof(string), "None");
  158. switch (fish)
  159. {
  160. case 1:
  161. {
  162. strmid(Fishes[playerid][pFish1], string, 0, strlen(string), 255);
  163. Fishes[playerid][pWeight1] = 0;
  164. Fishes[playerid][pFid1] = 0;
  165. }
  166. case 2:
  167. {
  168. strmid(Fishes[playerid][pFish2], string, 0, strlen(string), 255);
  169. Fishes[playerid][pWeight2] = 0;
  170. Fishes[playerid][pFid2] = 0;
  171. }
  172. case 3:
  173. {
  174. strmid(Fishes[playerid][pFish3], string, 0, strlen(string), 255);
  175. Fishes[playerid][pWeight3] = 0;
  176. Fishes[playerid][pFid3] = 0;
  177. }
  178. case 4:
  179. {
  180. strmid(Fishes[playerid][pFish4], string, 0, strlen(string), 255);
  181. Fishes[playerid][pWeight4] = 0;
  182. Fishes[playerid][pFid4] = 0;
  183. }
  184. case 5:
  185. {
  186. strmid(Fishes[playerid][pFish5], string, 0, strlen(string), 255);
  187. Fishes[playerid][pWeight5] = 0;
  188. Fishes[playerid][pFid5] = 0;
  189. }
  190. }
  191. }
  192. return 1;
  193. }
  194. CMD:fishhelp(playerid, params[])
  195. {
  196. SetPVarInt(playerid, "HelpResultCat0", 5);
  197. Help_ListCat(playerid, DIALOG_HELPCATOTHER1);
  198. return 1;
  199. }
  200. CMD:ofishhelp(playerid, params[])
  201. {
  202. SendClientMessageEx(playerid, COLOR_GREEN,"_______________________________________");
  203. SendClientMessageEx(playerid, COLOR_WHITE,"*** FISH HELP *** - type a command for more infomation.");
  204. SendClientMessageEx(playerid, COLOR_GRAD3,"*** FISHING *** /fish (Try to catch a fish) /fishes (Show the fishes you have caught)");
  205. SendClientMessageEx(playerid, COLOR_GRAD3,"*** FISHING *** /throwback (Throw the last fish you caught back) /throwbackall");
  206. SendClientMessageEx(playerid, COLOR_GRAD3,"*** FISHING *** /releasefish (Release one of your fishes)");
  207. return 1;
  208. }
  209. CMD:sellfish(playerid, params[])
  210. {
  211. if (!IsAt247(playerid))
  212. {
  213. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not in a 24-7!");
  214. return 1;
  215. }
  216. new fishid;
  217. if(sscanf(params, "d", fishid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /sellfish [fish]");
  218. new price;
  219. if(fishid < 1 || fishid > 5) return SendClientMessageEx(playerid, COLOR_GREY, " Fish number cant be below 1 or above 5!");
  220. if(fishid == 1 && Fishes[playerid][pWeight1] < 1) { SendClientMessageEx(playerid, COLOR_GREY, " You didnt even catch a Fish at that number(1)!"); return 1; }
  221. if(fishid == 2 && Fishes[playerid][pWeight2] < 1) { SendClientMessageEx(playerid, COLOR_GREY, " You didnt even catch a Fish at that number(2)!"); return 1; }
  222. if(fishid == 3 && Fishes[playerid][pWeight3] < 1) { SendClientMessageEx(playerid, COLOR_GREY, " You didnt even catch a Fish at that number(3)!"); return 1; }
  223. if(fishid == 4 && Fishes[playerid][pWeight4] < 1) { SendClientMessageEx(playerid, COLOR_GREY, " You didnt even catch a Fish at that number(4)!"); return 1; }
  224. if(fishid == 5 && Fishes[playerid][pWeight5] < 1) { SendClientMessageEx(playerid, COLOR_GREY, " You didnt even catch a Fish at that number(5)!"); return 1; }
  225. switch (fishid)
  226. {
  227. case 1:
  228. {
  229. if(Fishes[playerid][pWeight1] < 20)
  230. {
  231. SendClientMessageEx(playerid, COLOR_WHITE, "We are only interested in Fishes weighting 20 LBS or more.");
  232. return 1;
  233. }
  234. price = FishCost(playerid, Fishes[playerid][pFid1]);
  235. price = price * Fishes[playerid][pWeight1];
  236. GameTextForPlayer(playerid, "~g~Fish~n~~r~Sold", 3000, 1);
  237. format(szMiscArray, sizeof(szMiscArray), "* You have sold your %s that weights %d, for $%d.", Fishes[playerid][pFish1],Fishes[playerid][pWeight1],price);
  238. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMiscArray);
  239. GivePlayerCash(playerid, price);
  240. ClearFishID(playerid, 1);
  241. }
  242. case 2:
  243. {
  244. if(Fishes[playerid][pWeight2] < 20)
  245. {
  246. SendClientMessageEx(playerid, COLOR_WHITE, "We are only interested in Fishes weighting 20 LBS or more.");
  247. return 1;
  248. }
  249. price = FishCost(playerid, Fishes[playerid][pFid2]);
  250. price = price * Fishes[playerid][pWeight2];
  251. GameTextForPlayer(playerid, "~g~Fish~n~~r~Sold", 3000, 1);
  252. format(szMiscArray, sizeof(szMiscArray), "* You have sold your %s that weights %d, for $%d.", Fishes[playerid][pFish2],Fishes[playerid][pWeight2],price);
  253. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMiscArray);
  254. GivePlayerCash(playerid, price);
  255. ClearFishID(playerid, 2);
  256. }
  257. case 3:
  258. {
  259. if(Fishes[playerid][pWeight3] < 20)
  260. {
  261. SendClientMessageEx(playerid, COLOR_WHITE, "We are only interested in Fishes weighting 20 LBS or more.");
  262. return 1;
  263. }
  264. price = FishCost(playerid, Fishes[playerid][pFid3]);
  265. price = price * Fishes[playerid][pWeight3];
  266. GameTextForPlayer(playerid, "~g~Fish~n~~r~Sold", 3000, 1);
  267. format(szMiscArray, sizeof(szMiscArray), "* You have sold your %s that weights %d, for $%d.", Fishes[playerid][pFish3],Fishes[playerid][pWeight3],price);
  268. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMiscArray);
  269. GivePlayerCash(playerid, price);
  270. ClearFishID(playerid, 3);
  271. }
  272. case 4:
  273. {
  274. if(Fishes[playerid][pWeight4] < 20)
  275. {
  276. SendClientMessageEx(playerid, COLOR_WHITE, "We are only interested in Fishes weighting 20 LBS or more.");
  277. return 1;
  278. }
  279. price = FishCost(playerid, Fishes[playerid][pFid4]);
  280. price = price * Fishes[playerid][pWeight4];
  281. GameTextForPlayer(playerid, "~g~Fish~n~~r~Sold", 3000, 1);
  282. format(szMiscArray, sizeof(szMiscArray), "* You have sold your %s that weights %d, for $%d.", Fishes[playerid][pFish4],Fishes[playerid][pWeight4],price);
  283. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMiscArray);
  284. GivePlayerCash(playerid, price);
  285. ClearFishID(playerid, 4);
  286. }
  287. case 5:
  288. {
  289. if(Fishes[playerid][pWeight5] < 20)
  290. {
  291. SendClientMessageEx(playerid, COLOR_WHITE, "We are only interested in Fishes weighting 20 LBS or more.");
  292. return 1;
  293. }
  294. price = FishCost(playerid, Fishes[playerid][pFid5]);
  295. price = price * Fishes[playerid][pWeight5];
  296. GameTextForPlayer(playerid, "~g~Fish~n~~r~Sold", 3000, 1);
  297. format(szMiscArray, sizeof(szMiscArray), "* You have sold your %s that weights %d, for $%d.", Fishes[playerid][pFish5],Fishes[playerid][pWeight5],price);
  298. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMiscArray);
  299. GivePlayerCash(playerid, price);
  300. ClearFishID(playerid, 5);
  301. }
  302. }
  303. Fishes[playerid][pLastFish] = 0;
  304. Fishes[playerid][pFishID] = 0;
  305. return 1;
  306. }
  307. CMD:fish(playerid, params[])
  308. {
  309. if(PlayerInfo[playerid][pFishes] > 5)
  310. {
  311. SendClientMessageEx(playerid, COLOR_GREY, "You've caught enough fish for now - take a break.");
  312. return 1;
  313. }
  314. if(Fishes[playerid][pWeight1] > 0 && Fishes[playerid][pWeight2] > 0 && Fishes[playerid][pWeight3] > 0 && Fishes[playerid][pWeight4] > 0 && Fishes[playerid][pWeight5] > 0)
  315. {
  316. SendClientMessageEx(playerid, COLOR_GREY, "You can't carry more than five fish at a time - sell or release them first.");
  317. return 1;
  318. }
  319. new string[128];
  320. new Veh = GetPlayerVehicleID(playerid);
  321. if((IsAtFishPlace(playerid)) || IsABoat(Veh))
  322. {
  323. new Caught;
  324. new rand;
  325. new fstring[MAX_PLAYER_NAME];
  326. new Level = PlayerInfo[playerid][pFishSkill];
  327. if(Level >= 0 && Level <= 50) { Caught = random(20)-7; }
  328. else if(Level >= 51 && Level <= 100) { Caught = random(50)-20; }
  329. else if(Level >= 101 && Level <= 200) { Caught = random(100)-50; }
  330. else if(Level >= 201 && Level <= 400) { Caught = random(160)-60; }
  331. else if(Level >= 401) { Caught = random(180)-70; }
  332. rand = random(sizeof(FishNames));
  333. if(Caught <= 0)
  334. {
  335. SendClientMessageEx(playerid, COLOR_GREY, "The line snapped.");
  336. return 1;
  337. }
  338. else if(rand == 0)
  339. {
  340. SendClientMessageEx(playerid, COLOR_GREY, "You caught a jacket and threw it away.");
  341. return 1;
  342. }
  343. else if(rand == 4)
  344. {
  345. SendClientMessageEx(playerid, COLOR_GREY, "You caught a pair of trousers and threw it away.");
  346. return 1;
  347. }
  348. else if(rand == 7)
  349. {
  350. SendClientMessageEx(playerid, COLOR_GREY, "You caught a can and threw it away.");
  351. return 1;
  352. }
  353. else if(rand == 10)
  354. {
  355. SendClientMessageEx(playerid, COLOR_GREY, "You caught a pair of shoes and threw it away.");
  356. return 1;
  357. }
  358. else if(rand == 13)
  359. {
  360. SendClientMessageEx(playerid, COLOR_GREY, "You caught some garbage and threw it away.");
  361. return 1;
  362. }
  363. else if(rand == 20)
  364. {
  365. new mrand = random(500);
  366. format(string, sizeof(string), "* You caught a bag filled with money ($%d).", mrand);
  367. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  368. GivePlayerCash(playerid, mrand);
  369. return 1;
  370. }
  371. if(Fishes[playerid][pWeight1] == 0)
  372. {
  373. PlayerInfo[playerid][pFishes] += 1;
  374. if(PlayerInfo[playerid][pDoubleEXP] > 0)
  375. {
  376. format(string, sizeof(string), "You have gained 2 fisher skill points instead of 1. You have %d hours left on the Double EXP token.", PlayerInfo[playerid][pDoubleEXP]);
  377. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  378. PlayerInfo[playerid][pFishSkill] += 2;
  379. }
  380. else
  381. {
  382. PlayerInfo[playerid][pFishSkill] += 1;
  383. }
  384. format(fstring, sizeof(fstring), "%s", FishNames[rand]);
  385. strmid(Fishes[playerid][pFish1], fstring, 0, strlen(fstring), 255);
  386. Fishes[playerid][pWeight1] = Caught;
  387. format(string, sizeof(string), "* You have caught a %s, weighing %d pounds.", Fishes[playerid][pFish1], Caught);
  388. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  389. Fishes[playerid][pLastWeight] = Caught;
  390. Fishes[playerid][pLastFish] = 1;
  391. Fishes[playerid][pFid1] = rand;
  392. Fishes[playerid][pFishID] = rand;
  393. if(Caught > PlayerInfo[playerid][pBiggestFish])
  394. {
  395. format(string, sizeof(string), "* Your old record of %d pounds has been passed, your new record is %d pounds.", PlayerInfo[playerid][pBiggestFish], Caught);
  396. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  397. PlayerInfo[playerid][pBiggestFish] = Caught;
  398. }
  399. }
  400. else if(Fishes[playerid][pWeight2] == 0)
  401. {
  402. PlayerInfo[playerid][pFishes] += 1;
  403. if(PlayerInfo[playerid][pDoubleEXP] > 0)
  404. {
  405. format(string, sizeof(string), "You have gained 2 fisher skill points instead of 1. You have %d hours left on the Double EXP token.", PlayerInfo[playerid][pDoubleEXP]);
  406. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  407. PlayerInfo[playerid][pFishSkill] += 2;
  408. }
  409. else
  410. {
  411. PlayerInfo[playerid][pFishSkill] += 1;
  412. }
  413. format(fstring, sizeof(fstring), "%s", FishNames[rand]);
  414. strmid(Fishes[playerid][pFish2], fstring, 0, strlen(fstring), 255);
  415. Fishes[playerid][pWeight2] = Caught;
  416. format(string, sizeof(string), "* You have caught a %s, weighing %d pounds.", Fishes[playerid][pFish2], Caught);
  417. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  418. Fishes[playerid][pLastWeight] = Caught;
  419. Fishes[playerid][pLastFish] = 2;
  420. Fishes[playerid][pFid2] = rand;
  421. Fishes[playerid][pFishID] = rand;
  422. if(Caught > PlayerInfo[playerid][pBiggestFish])
  423. {
  424. format(string, sizeof(string), "* Your old record of %d pounds has been passed, your new record is %d pounds.", PlayerInfo[playerid][pBiggestFish], Caught);
  425. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  426. PlayerInfo[playerid][pBiggestFish] = Caught;
  427. }
  428. }
  429. else if(Fishes[playerid][pWeight3] == 0)
  430. {
  431. PlayerInfo[playerid][pFishes] += 1;
  432. if(PlayerInfo[playerid][pDoubleEXP] > 0)
  433. {
  434. format(string, sizeof(string), "You have gained 2 fisher skill points instead of 1. You have %d hours left on the Double EXP token.", PlayerInfo[playerid][pDoubleEXP]);
  435. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  436. PlayerInfo[playerid][pFishSkill] += 2;
  437. }
  438. else
  439. {
  440. PlayerInfo[playerid][pFishSkill] += 1;
  441. }
  442. format(fstring, sizeof(fstring), "%s", FishNames[rand]);
  443. strmid(Fishes[playerid][pFish3], fstring, 0, strlen(fstring), 255);
  444. Fishes[playerid][pWeight3] = Caught;
  445. format(string, sizeof(string), "* You have caught a %s, weighing %d pounds.", Fishes[playerid][pFish3], Caught);
  446. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  447. Fishes[playerid][pLastWeight] = Caught;
  448. Fishes[playerid][pLastFish] = 3;
  449. Fishes[playerid][pFid3] = rand;
  450. Fishes[playerid][pFishID] = rand;
  451. if(Caught > PlayerInfo[playerid][pBiggestFish])
  452. {
  453. format(string, sizeof(string), "* Your old record of %d pounds has been passed, your new record is %d pounds.", PlayerInfo[playerid][pBiggestFish], Caught);
  454. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  455. PlayerInfo[playerid][pBiggestFish] = Caught;
  456. }
  457. }
  458. else if(Fishes[playerid][pWeight4] == 0)
  459. {
  460. PlayerInfo[playerid][pFishes] += 1;
  461. if(PlayerInfo[playerid][pDoubleEXP] > 0)
  462. {
  463. format(string, sizeof(string), "You have gained 2 fisher skill points instead of 1. You have %d hours left on the Double EXP token.", PlayerInfo[playerid][pDoubleEXP]);
  464. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  465. PlayerInfo[playerid][pFishSkill] += 2;
  466. }
  467. else
  468. {
  469. PlayerInfo[playerid][pFishSkill] += 1;
  470. }
  471. format(fstring, sizeof(fstring), "%s", FishNames[rand]);
  472. strmid(Fishes[playerid][pFish4], fstring, 0, strlen(fstring), 255);
  473. Fishes[playerid][pWeight4] = Caught;
  474. format(string, sizeof(string), "* You have caught a %s, weighing %d pounds.", Fishes[playerid][pFish4], Caught);
  475. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  476. Fishes[playerid][pLastWeight] = Caught;
  477. Fishes[playerid][pLastFish] = 4;
  478. Fishes[playerid][pFid4] = rand;
  479. Fishes[playerid][pFishID] = rand;
  480. if(Caught > PlayerInfo[playerid][pBiggestFish])
  481. {
  482. format(string, sizeof(string), "* Your old record of %d pounds has been passed, your new record is %d pounds.", PlayerInfo[playerid][pBiggestFish], Caught);
  483. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  484. PlayerInfo[playerid][pBiggestFish] = Caught;
  485. }
  486. }
  487. else if(Fishes[playerid][pWeight5] == 0)
  488. {
  489. PlayerInfo[playerid][pFishes] += 1;
  490. if(PlayerInfo[playerid][pDoubleEXP] > 0)
  491. {
  492. format(string, sizeof(string), "You have gained 2 fisher skill points instead of 1. You have %d hours left on the Double EXP token.", PlayerInfo[playerid][pDoubleEXP]);
  493. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  494. PlayerInfo[playerid][pFishSkill] += 2;
  495. }
  496. else
  497. {
  498. PlayerInfo[playerid][pFishSkill] += 1;
  499. }
  500. format(fstring, sizeof(fstring), "%s", FishNames[rand]);
  501. strmid(Fishes[playerid][pFish5], fstring, 0, strlen(fstring), 255);
  502. Fishes[playerid][pWeight5] = Caught;
  503. format(string, sizeof(string), "* You have caught a %s, weighing %d pounds.", Fishes[playerid][pFish5], Caught);
  504. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  505. Fishes[playerid][pLastWeight] = Caught;
  506. Fishes[playerid][pLastFish] = 5;
  507. Fishes[playerid][pFid5] = rand;
  508. Fishes[playerid][pFishID] = rand;
  509. if(Caught > PlayerInfo[playerid][pBiggestFish])
  510. {
  511. format(string, sizeof(string), "* Your old record of %d pounds has been passed, your new record is %d pounds.", PlayerInfo[playerid][pBiggestFish], Caught);
  512. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  513. PlayerInfo[playerid][pBiggestFish] = Caught;
  514. }
  515. }
  516. else
  517. {
  518. SendClientMessageEx(playerid, COLOR_GREY, "You don't have any space for your fish.");
  519. return 1;
  520. }
  521. if(PlayerInfo[playerid][pFishSkill] == 50) SendClientMessageEx(playerid, COLOR_YELLOW, "* Your Fishing Skill is now Level 2, you can now catch larger fish.");
  522. else if(PlayerInfo[playerid][pFishSkill] == 100) SendClientMessageEx(playerid, COLOR_YELLOW, "* Your Fishing Skill is now Level 3, you can now catch larger fish.");
  523. else if(PlayerInfo[playerid][pFishSkill] == 200) SendClientMessageEx(playerid, COLOR_YELLOW, "* Your Fishing Skill is now Level 4, you can now catch larger fish.");
  524. else if(PlayerInfo[playerid][pFishSkill] == 400) SendClientMessageEx(playerid, COLOR_YELLOW, "* Your Fishing Skill is now Level 5, you can now catch larger fish.");
  525. if(PlayerInfo[playerid][pFishSkill] == 400) PlayerInfo[playerid][pFishSkill] = 400;
  526. }
  527. else
  528. {
  529. SendClientMessageEx(playerid, COLOR_GREY, "You're not at the Santa Maria Pier, or on a fishing boat.");
  530. return 1;
  531. }
  532. return 1;
  533. }
  534. CMD:fishes(playerid, params[])
  535. {
  536. new string[128];
  537. SendClientMessageEx(playerid, COLOR_WHITE, "|__________________ Fishes __________________|");
  538. format(string, sizeof(string), "** (1) Fish: %s. Weight: %d.", Fishes[playerid][pFish1], Fishes[playerid][pWeight1]);
  539. SendClientMessageEx(playerid, COLOR_GREY, string);
  540. format(string, sizeof(string), "** (2) Fish: %s. Weight: %d.", Fishes[playerid][pFish2], Fishes[playerid][pWeight2]);
  541. SendClientMessageEx(playerid, COLOR_GREY, string);
  542. format(string, sizeof(string), "** (3) Fish: %s. Weight: %d.", Fishes[playerid][pFish3], Fishes[playerid][pWeight3]);
  543. SendClientMessageEx(playerid, COLOR_GREY, string);
  544. format(string, sizeof(string), "** (4) Fish: %s. Weight: %d.", Fishes[playerid][pFish4], Fishes[playerid][pWeight4]);
  545. SendClientMessageEx(playerid, COLOR_GREY, string);
  546. format(string, sizeof(string), "** (5) Fish: %s. Weight: %d.", Fishes[playerid][pFish5], Fishes[playerid][pWeight5]);
  547. SendClientMessageEx(playerid, COLOR_GREY, string);
  548. SendClientMessageEx(playerid, COLOR_WHITE, "|____________________________________________|");
  549. return 1;
  550. }
  551. CMD:releasefish(playerid, params[])
  552. {
  553. new fishid;
  554. if(sscanf(params, "d", fishid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /releasefish [fish 1-5]");
  555. if(fishid < 1 || fishid > 5) { SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /releasefish [fish 1-5]"); return 1; }
  556. else if(fishid == 1 && Fishes[playerid][pWeight1] < 1) { SendClientMessageEx(playerid, COLOR_GREY, "That slot is empty."); return 1; }
  557. else if(fishid == 2 && Fishes[playerid][pWeight2] < 1) { SendClientMessageEx(playerid, COLOR_GREY, "That slot is empty."); return 1; }
  558. else if(fishid == 3 && Fishes[playerid][pWeight3] < 1) { SendClientMessageEx(playerid, COLOR_GREY, "That slot is empty."); return 1; }
  559. else if(fishid == 4 && Fishes[playerid][pWeight4] < 1) { SendClientMessageEx(playerid, COLOR_GREY, "That slot is empty."); return 1; }
  560. else if(fishid == 5 && Fishes[playerid][pWeight5] < 1) { SendClientMessageEx(playerid, COLOR_GREY, "That slot is empty."); return 1; }
  561. ClearFishID(playerid, fishid);
  562. Fishes[playerid][pLastFish] = 0;
  563. Fishes[playerid][pFishID] = 0;
  564. SendClientMessageEx(playerid, COLOR_GREY, "You released a fish");
  565. return 1;
  566. }
  567. CMD:throwback(playerid, params[])
  568. {
  569. if(Fishes[playerid][pLastFish] > 0)
  570. {
  571. ClearFishID(playerid, Fishes[playerid][pLastFish]);
  572. Fishes[playerid][pLastFish] = 0;
  573. Fishes[playerid][pFishID] = 0;
  574. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You have thrown back your last fish.");
  575. }
  576. else
  577. {
  578. SendClientMessageEx(playerid, COLOR_GREY, "You haven't even caught a fish yet.");
  579. return 1;
  580. }
  581. return 1;
  582. }
  583. CMD:throwbackall(playerid, params[])
  584. {
  585. if(Fishes[playerid][pWeight1] > 0 || Fishes[playerid][pWeight2] > 0 || Fishes[playerid][pWeight3] > 0 || Fishes[playerid][pWeight4] > 0 || Fishes[playerid][pWeight5] > 0)
  586. {
  587. ClearFishes(playerid);
  588. Fishes[playerid][pLastFish] = 0;
  589. Fishes[playerid][pFishID] = 0;
  590. SendClientMessageEx(playerid, COLOR_GREY, "You have thrown back all your fish");
  591. }
  592. else
  593. {
  594. SendClientMessageEx(playerid, COLOR_GREY, "You haven't even caught a fish yet.");
  595. return 1;
  596. }
  597. return 1;
  598. }