1
0

hank.inc 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. #define DIALOG_ISLAND 2453
  2. #define COLOR_LIMEGREEN 0x10F441AA
  3. // Variables
  4. new HankDJ[MAX_PLAYERS];
  5. new HankCurrentSong[128];
  6. new IClose;
  7. new DonationIsland;
  8. new IslandLogin[MAX_PLAYERS];
  9. new adtimerIs;
  10. new FishingTimeIS[MAX_PLAYERS];
  11. new Fish[MAX_PLAYERS];
  12. Hook:eh_OnGameModeInit()
  13. {
  14. CreateDynamicPickup(1239, 2, 675.1188,-2294.3250,5.8098, -1);
  15. Create3DTextLabel("~Tia's Island General Store~", COLOR_LIMEGREEN, 675.1188,-2294.3250,5.8098, 40.0, 0, 1);
  16. CreateDynamicPickup(1239, 2, 737.5669,-2332.7700,1.5416 , -1);
  17. Create3DTextLabel("~Fishing Range~\n Press Y", COLOR_LIMEGREEN, 737.5669,-2332.7700,1.5416, 40.0, 0, 1);
  18. CreateDynamicPickup(1239, 2, 708.9966,-2330.2515,8.0751 , -1);
  19. Create3DTextLabel("~Fish Box~", COLOR_LIMEGREEN, 708.9966,-2330.2515,8.0751, 40.0, 0, 1);
  20. CreateDynamicPickup(1239, 2, 705.9294,-2341.3477,6.4736, -1);
  21. Create3DTextLabel("~Fixing Point~", COLOR_LIMEGREEN, 705.9294, -2341.3477, 6.4736, 40.0, 0, 1);
  22. LoadHankdata();
  23. return 1;
  24. }
  25. CMD:imusic(playerid, params[]) {
  26. if(HankDJ[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "You are not a DJ!");
  27. if(!IsPlayerInRangeOfPoint(playerid, 100.0, 700.2119,-2306.7632,10.1280)) return SendClientMessage(playerid, COLOR_GREY, "You are not at the Island!");
  28. if(sscanf(params, "s[128]", HankCurrentSong)) return SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /imusic [URL]");
  29. foreach(new p : Player) {
  30. if(IsPlayerInRangeOfPoint(playerid, 100.0, 700.2119,-2306.7632,10.1280)) {
  31. // Play music and display song name for each player.
  32. PlayAudioStreamForPlayer(p, HankCurrentSong, 700.2119,-2306.7632,10.1280, 100, 1);
  33. SendClientMessage(p, COLOR_ORANGE, "[Island] The song was changed by the DJ.");
  34. }
  35. }
  36. return 1;
  37. }
  38. CMD:ilocate(playerid) {
  39. SetPlayerCheckpoint(playerid, 684.5220,-2257.2024,2.2046, 3.0);
  40. SendClientMessage(playerid, COLOR_YELLOW, "Map: {ffffff}Tia's Island has been marked on your minimap. Use (/killcp) to remove checkpoint.");
  41. return 1;
  42. }
  43. SendIslandMessage(color, string2[])
  44. {
  45. foreach( new i: Player )
  46. {
  47. if(IsPlayerConnected(i))
  48. {
  49. if(IslandLogin[i] == 1)
  50. {
  51. SendClientMessage(i, color, string2);
  52. }
  53. }
  54. }
  55. return 1;
  56. }
  57. CMD:imessage(playerid, params[]) {
  58. new Text[128];
  59. new line[200];
  60. if(IClose == 1) return SendClientMessage(playerid, COLOR_GREY, "The hotline is closed at the moment.");
  61. if(sscanf(params, "s[128]", Text)) return SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /imessage [Text]");
  62. format(line, sizeof(line), "Phone Number [%d]: %s", PlayerInfo[playerid][pPnumber], Text);
  63. SendIslandMessage(COLOR_GEAR_BLUE, line);
  64. SendClientMessage(playerid, COLOR_GEAR_YELLOW, "Your message was delivered to the owners of Tia's Island, thank you.");
  65. GiveMoney(playerid, -25);
  66. return 1;
  67. }
  68. CMD:ifix(playerid, params[]) {
  69. if(!IsPlayerInRangeOfPoint(playerid, 5.0, 705.9294,-2341.3477,6.4736)) return SendClientMessage(playerid, 0xC92C00FF, "You are not near the vehicle fix point.");
  70. if(IClose == 1) return SendClientMessage(playerid, 0xC92C00FF, "Fix service is closed right now, come back later.");
  71. if(!IsPlayerInAnyVehicle(playerid) || GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xC92C00FF, "You are not the driver of a vehicle.");
  72. if(PlayerInfo[playerid][pCash] < 750) {
  73. SendClientMessage(playerid, 0xC92C00FF, "You don't have enough money. Required ($750).");
  74. return 1;
  75. }
  76. GivePlayerMoney(playerid, -750);
  77. PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
  78. GameTextForPlayer(playerid, "~g~Vehicle fixed", 2000, 3);
  79. RepairVehicle(GetPlayerVehicleID(playerid));
  80. DonationIsland += 750;
  81. SendClientMessage(playerid, COLOR_WHITE, "[Island Message]: Thank you, visit again.");
  82. SaveHankdata();
  83. return 1;
  84. }
  85. CMD:ic(playerid, params[]) {
  86. new Text[128];
  87. new line[200];
  88. if(IslandLogin[playerid] == 1)
  89. {
  90. if(sscanf(params, "s[128]", Text)) return SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /ichat [Text]");
  91. format(line, sizeof(line), "[Island Chat] %s: %s", PlayerICName(playerid), Text);
  92. SendIslandMessage(COLOR_GEAR_BLUE, line);
  93. }
  94. else SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use this command.");
  95. return 1;
  96. }
  97. CMD:ilogin(playerid, params[]) {
  98. new login;
  99. new line[200];
  100. if(IslandLogin[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You're already logged into the Tia's Island System."); // to be replaced by mine and tia's id
  101. if(sscanf(params, "d", login)) return SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /ilogin [password]");
  102. if(login == 2)
  103. {
  104. IslandLogin[playerid] = 1;
  105. format(line, sizeof(line), "Tommy Update: {ffffff}%s has logged into the Tia's Island System.", PlayerICName(playerid));
  106. SendIslandMessage(COLOR_GEAR_RED, line);
  107. }
  108. else SendClientMessage(playerid, COLOR_GREY, "The password you've entered is wrong, sorry.");
  109. return 1;
  110. }
  111. CMD:islandinfo(playerid, params[]) {
  112. SendClientMessage(playerid, COLOR_YELLOW, "____________________Tia James' Island Information____________________");
  113. SendClientMessage(playerid, -1, "How to get there? You can get to Tia's Island by roadway, seaway and airway.");
  114. SendClientMessage(playerid, -1, "Who found Tia's Island? Hank James found Tia's Island, it's located in the middle of LS sea.");
  115. SendClientMessage(playerid, -1, "Services available at Tia's Island? Fishing n' Selling services, cheap shops for general items, mechanic, music, etc. etc!");
  116. return 1;
  117. }
  118. CMD:iclose(playerid, params[]) {
  119. if(IslandLogin[playerid] != 1) return SendClientMessage(playerid, COLOR_GREY, "You're not allowed to use this command.");
  120. if(IClose == 0)
  121. {
  122. IClose = 1;
  123. SendIslandMessage(COLOR_GEAR_RED, "Tommy Update: {ffffff}The services of Tia's Island were pulled down.");
  124. SaveHankdata();
  125. }
  126. else if(IClose == 1)
  127. {
  128. IClose = 0;
  129. SendIslandMessage(COLOR_GEAR_RED, "Tommy Update: {ffffff}The services of Tia's Island were pulled up.");
  130. SaveHankdata();
  131. }
  132. return 1;
  133. }
  134. CMD:imic(playerid, params[]) {
  135. new micsays[128];
  136. new line[200];
  137. if(HankDJ[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "You're not a DJ to use mic, sorry.");
  138. if(!IsPlayerInRangeOfPoint(playerid, 100.0, 700.2119,-2306.7632,10.1280)) return SendClientMessage(playerid, COLOR_GREY, "You are not at the Island!");
  139. if(sscanf(params, "s[128]", micsays)) return SendClientMessage(playerid, COLOR_GEAR_PURPLE, "{00BFFF}Usage:{FFFFFF} /imic [Text]");
  140. format(line, sizeof(line), "%s [MIC]: %s", PlayerICName(playerid), micsays);
  141. foreach(new p : Player) {
  142. if(IsPlayerInRangeOfPoint(p, 100.0, 700.2119,-2306.7632,10.1280)) {
  143. SendClientMessage(p, COLOR_GEAR_RED, line);
  144. }
  145. }
  146. return 1;
  147. }
  148. CMD:ibuy(playerid, params[]) {
  149. if(IClose == 1) return SendClientMessage(playerid, COLOR_GREY, "The services are closed right now, come back later.");
  150. if(!IsPlayerInRangeOfPoint(playerid, 3.0, 675.1188,-2294.3250,5.8098)) return SendClientMessage(playerid, COLOR_GREY, "You are not at the Island!");
  151. ShowPlayerDialog(playerid, DIALOG_ISLAND, DIALOG_STYLE_TABLIST, "Island General Shop", "Dice\t$500\nSpraycan\t$200\nRope\t$1000\nCigars\t$50\nSprunk\t$10\nWalkie Talkie\t$200\nScrewdriver\t$50\nBlindfolds\t$2000\nCards\t$1500\nFlower\t$50\nStereo\t$3000\nMatches\t$250\nBeer\t$500", "Select", "Cancel");
  152. return 1;
  153. }
  154. CMD:isell(playerid, params[]) {
  155. new fish1 = Fish[playerid];
  156. new price;
  157. new woah[128];
  158. if(!IsPlayerInRangeOfPoint(playerid, 2.0, 708.9966,-2330.2515,8.0751)) return SendClientMessage(playerid, COLOR_GREY, "You're not at the fish box on Island.");
  159. if(IClose == 1) return SendClientMessage(playerid, COLOR_GREY, "Fishing service is closed right now, come back later.");
  160. if(fish1 >= 1)
  161. {
  162. if(fish1 == 1 && fish1 < 55)
  163. {
  164. Fish[playerid] = 0;
  165. price = random(150) + 300;
  166. GiveMoney(playerid, price);
  167. format(woah, sizeof(woah), "You sold off the fish for ($%d).", price);
  168. SendClientMessage(playerid, COLOR_LIGHTBLUE, woah);
  169. }
  170. if(fish1 > 55 && fish1 < 75)
  171. {
  172. Fish[playerid] = 0;
  173. price = random(150) + 400;
  174. GiveMoney(playerid, price);
  175. format(woah, sizeof(woah), "You sold off the fish for ($%d).", price);
  176. SendClientMessage(playerid, COLOR_LIGHTBLUE, woah);
  177. }
  178. if(fish1 > 75 && fish1 < 85)
  179. {
  180. Fish[playerid] = 0;
  181. price = random(150) + 600;
  182. GiveMoney(playerid, price);
  183. format(woah, sizeof(woah), "You sold off the fish for ($%d).", price);
  184. SendClientMessage(playerid, COLOR_LIGHTBLUE, woah);
  185. }
  186. }
  187. else SendClientMessage(playerid, COLOR_GREY, "You don't have a fish to sell off.");
  188. return 1;
  189. }
  190. forward Timer_Fishsearched(playerid);
  191. public Timer_Fishsearched(playerid)
  192. {
  193. FishingTimeIS[playerid] = 0;
  194. return 1;
  195. }
  196. CMD:imakedj(playerid, params[])
  197. {
  198. if(IslandLogin[playerid] == 1)
  199. {
  200. new targetid;
  201. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /imakedj [playerid]");
  202. if(HankDJ[targetid] == 0)
  203. {
  204. SendClientMessage(playerid, COLOR_GEAR_GREEN, "You've given them the status of DJ.");
  205. SendClientMessage(targetid, COLOR_GEAR_GREEN, "You've been given the status of DJ.");
  206. HankDJ[targetid] = 1;
  207. }
  208. else
  209. {
  210. SendClientMessage(targetid, COLOR_GEAR_GREEN, "Your DJ status was taken away.");
  211. SendClientMessage(playerid, COLOR_GEAR_GREEN, "You've taken away their DJ status.");
  212. HankDJ[targetid] = 0;
  213. }
  214. }
  215. else SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use this command.");
  216. return 1;
  217. }
  218. CMD:ipullout(playerid)
  219. {
  220. if(IslandLogin[playerid] == 1)
  221. {
  222. if(DonationIsland == 0) return SendClientMessage(playerid, COLOR_GREY, "There's no donation to withdraw.");
  223. GiveMoney(playerid, DonationIsland);
  224. DonationIsland = 0;
  225. SendClientMessage(playerid, COLOR_GREY, "You've pulled out whatever your Island's treasury has collected.");
  226. SendIslandMessage(COLOR_GEAR_RED, "Tommy Update: {ffffff}Treasury's money was withdrawn by someone.");
  227. SaveHankdata();
  228. }
  229. else SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use this command.");
  230. return 1;
  231. }
  232. CMD:iad(playerid)
  233. {
  234. if(IslandLogin[playerid] == 1)
  235. {
  236. if(IClose == 1) return SendClientMessage(playerid, COLOR_GREY, "The Island is closed right now, you cannot make advertisement.");
  237. if(adtimerIs == 1) return SendClientMessage(playerid, COLOR_GREY, "You've made an advertisement, please wait a minute to make one more.");
  238. SendClientMessageToAll(COLOR_GREEN, "Advertisement [2019]: Tia's Island is opened now! You all are invited. (/ilocate and /ihelp) to locate and know about the Island.");
  239. adtimerIs = 1;
  240. SetTimer("Timer_Isearched", 60000, 0);
  241. }
  242. else SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use this command.");
  243. return 1;
  244. }
  245. forward Timer_Isearched(playerid);
  246. public Timer_Isearched(playerid)
  247. {
  248. adtimerIs = 0;
  249. return 1;
  250. }
  251. CMD:idonate(playerid, params[])
  252. {
  253. new donate;
  254. new woah[122];
  255. if(!IsPlayerInRangeOfPoint(playerid, 2.0, 658.7969,-2304.2676,4.6387)) return SendClientMessage(playerid, COLOR_GREY, "You are not at the Tommy's Hut to donate.");
  256. if(IClose == 1) return SendClientMessage(playerid, COLOR_GREY, "Tommy says: Come back later, donation service is closed.");
  257. if(sscanf(params, "d", donate)) return SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /idonate [amount]");
  258. if(PlayerInfo[playerid][pCash] > donate)
  259. {
  260. if(donate < 1) return SendClientMessage(playerid, COLOR_RED, "You can't donate below $0 or $0!");
  261. GiveMoney(playerid, -donate);
  262. DonationIsland += donate;
  263. SendClientMessage(playerid, COLOR_GREY, "Tommy says: Thanks for your donation, we're glad to have you as a visitor.");
  264. SendIslandMessage(COLOR_GEAR_RED, "Tommy Update: {ffffff} Donation was added to the treasury.");
  265. format(woah, sizeof(woah), "[ISLAND]: {ffffff}%s has donated $%d to Tia James' Island! Thank You.", PlayerICName(playerid), donate);
  266. if(donate > 1000000) return SendClientMessageToAll(COLOR_ORANGE, woah);
  267. SaveHankdata();
  268. }
  269. else SendClientMessage(playerid, COLOR_GREY, "Tommy says: Looks like you don't have much. It's fine we don't need donation.");
  270. return 1;
  271. }
  272. CMD:ihelp(playerid, params[])
  273. {
  274. new wooh[100];
  275. SendClientMessage(playerid, COLOR_GREY, "____________________Tia James' Island Commands____________________");
  276. SendClientMessage(playerid, COLOR_GEAR_GREEN, "Commands(All): /ilocate, /isell, /idonate, /imessage, /islandinfo, /ifix, /ibuy");
  277. if(IslandLogin[playerid] == 1)
  278. {
  279. SendClientMessage(playerid, COLOR_GEAR_GREEN, "Commands(Owner): /imusic, /imakedj, /imic, /iclose, /ic, /ipullout, /iad, /ilogin");
  280. format(wooh, sizeof(wooh), "Total Island Treasury: $%d", DonationIsland);
  281. SendClientMessage(playerid, COLOR_GEAR_GREEN, wooh);
  282. }
  283. return 1;
  284. }
  285. stock SaveHankdata()
  286. {
  287. new file[25];
  288. format(file, sizeof(file), "HankJames.cfg");
  289. if(!dini_Exists(file)) dini_Create(file);
  290. dini_IntSet(file, "Donation", DonationIsland);
  291. dini_IntSet(file, "Closed", IClose);
  292. return 1;
  293. }
  294. stock LoadHankdata()
  295. {
  296. new file[25];
  297. format(file, sizeof(file), "HankJames.cfg");
  298. if(!dini_Exists(file)) dini_Create(file);
  299. DonationIsland = dini_Int(file, "Donation");
  300. IClose = dini_Int(file, "Closed");
  301. return 1;
  302. }
  303. Hook:eh_OnPlayerDisconnect(playerid, reason)
  304. {
  305. IslandLogin[playerid] = 0;
  306. HankDJ[playerid] = 0;
  307. Fish[playerid] = 0;
  308. FishingTimeIS[playerid] = 0;
  309. return 1;
  310. }
  311. Hook:eh_OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  312. {
  313. if(PRESSED(KEY_YES))
  314. {
  315. if(IsPlayerInRangeOfPoint(playerid, 30.0, 737.5669,-2332.7700,1.5416))
  316. {
  317. if(IClose == 1) return SendClientMessage(playerid, COLOR_GREY, "Fishing service is closed right now, come back later.");
  318. //if(PlayerHasRod[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "Use your rod in order to fish (/userod).");
  319. if(Fish[playerid] >= 1) return SendClientMessage(playerid, COLOR_GREY, "You already have a fish, sell it first {ffffff}(/isell).");
  320. new fish = random(100) - 15;
  321. if(FishingTimeIS[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You will have to wait 60 seconds before catching another fish.");
  322. if(fish < 1) return SendClientMessage(playerid, COLOR_RED, "You didn't catch any fish.");
  323. if(fish == 1 && fish < 55)
  324. {
  325. Fish[playerid] = fish;
  326. SendClientMessage(playerid, COLOR_LIGHTBLUE, "You've cought a small size fish.");
  327. FishingTimeIS[playerid] = 1;
  328. SetTimerEx("Timer_Fishsearched", 60000, 0, "i", playerid);
  329. }
  330. if(fish > 55 && fish < 75)
  331. {
  332. Fish[playerid] = fish;
  333. SendClientMessage(playerid, COLOR_LIGHTBLUE, "You've cought a medium size fish.");
  334. FishingTimeIS[playerid] = 1;
  335. SetTimerEx("Timer_Fishsearched", 60000, 0, "i", playerid);
  336. }
  337. if(fish > 75 && fish < 85)
  338. {
  339. Fish[playerid] = fish;
  340. SendClientMessage(playerid, COLOR_LIGHTBLUE, "You've cought a large size fish.");
  341. FishingTimeIS[playerid] = 1;
  342. SetTimerEx("Timer_Fishsearched", 60000, 0, "i", playerid);
  343. }
  344. return 1;
  345. }
  346. }
  347. return 1;
  348. }
  349. Hook:eh_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  350. {
  351. if(dialogid == DIALOG_ISLAND)
  352. {
  353. if(response)
  354. {
  355. new str[245];
  356. if(listitem == 0) //dice
  357. {
  358. if(PlayerInfo[playerid][pDice] == 1)
  359. {
  360. SendClientMessage(playerid, COLOR_GREY, "You already have dice.");
  361. return 1;
  362. }
  363. if(PlayerInfo[playerid][pCash] > 499)
  364. {
  365. GiveMoney(playerid, -500);
  366. DonationIsland += 500;
  367. PlayerInfo[playerid][pDice] = 1;
  368. format(str, sizeof(str), "~r~-$%d", 500);
  369. GameTextForPlayer(playerid, str, 5000, 1);
  370. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  371. SaveHankdata();
  372. }
  373. else
  374. {
  375. return SendClientMessage(playerid, COLOR_GREY, "You can't afford that.");
  376. }
  377. }
  378. if(listitem == 1)
  379. {
  380. if(PlayerInfo[playerid][pSpraycan] >= 10)
  381. {
  382. SendClientMessage(playerid, COLOR_GREY, "You already have 10 or more spray cans.");
  383. return 1;
  384. }
  385. if(PlayerInfo[playerid][pCash] >= 200)
  386. {
  387. GiveMoney(playerid, -200);
  388. DonationIsland += 200;
  389. PlayerInfo[playerid][pSpraycan] += 10;
  390. format(str, sizeof(str), "~r~-$%d", 200);
  391. GameTextForPlayer(playerid, str, 5000, 1);
  392. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  393. SaveHankdata();
  394. }
  395. else
  396. {
  397. return SendClientMessage(playerid, COLOR_GREY, "You can't afford that.");
  398. }
  399. }
  400. if(listitem == 2)
  401. {
  402. if(PlayerInfo[playerid][pRope] >= 9)
  403. {
  404. SendClientMessage(playerid, COLOR_GREY, "You already have 9 or more ropes.");
  405. return 1;
  406. }
  407. if(PlayerInfo[playerid][pCash] > 999)
  408. {
  409. GiveMoney(playerid, -1000);
  410. DonationIsland += 1000;
  411. PlayerInfo[playerid][pRope] += 3;
  412. format(str, sizeof(str), "~r~-$%d", 1000);
  413. GameTextForPlayer(playerid, str, 5000, 1);
  414. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  415. SaveHankdata();
  416. }
  417. else
  418. {
  419. return SendClientMessage(playerid, COLOR_GREY, "You can't afford that.");
  420. }
  421. }
  422. if(listitem == 3)
  423. {
  424. if(PlayerInfo[playerid][pCigars] >= 10)
  425. {
  426. SendClientMessage(playerid, COLOR_GREY, "You already have 10 or more cigars.");
  427. return 1;
  428. }
  429. if(PlayerInfo[playerid][pCash] > 50)
  430. {
  431. GiveMoney(playerid, -50);
  432. DonationIsland += 50;
  433. PlayerInfo[playerid][pCigars] += 10;
  434. format(str, sizeof(str), "~r~-$%d", 50);
  435. GameTextForPlayer(playerid, str, 5000, 1);
  436. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  437. SaveHankdata();
  438. }
  439. else
  440. {
  441. return SendClientMessage(playerid, COLOR_GREY, "You can't afford that.");
  442. }
  443. }
  444. if(listitem == 4)
  445. {
  446. if(PlayerInfo[playerid][pSprunk] >= 3)
  447. {
  448. SendClientMessage(playerid, COLOR_GREY, "You already have 3 or more cans of sprunk.");
  449. return 1;
  450. }
  451. if(PlayerInfo[playerid][pCash] > 9)
  452. {
  453. GiveMoney(playerid, -10);
  454. DonationIsland += 10;
  455. PlayerInfo[playerid][pSprunk] += 1;
  456. format(str, sizeof(str), "~r~-$%d", 10);
  457. GameTextForPlayer(playerid, str, 5000, 1);
  458. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  459. SaveHankdata();
  460. }
  461. else
  462. {
  463. return SendClientMessage(playerid, COLOR_GREY, "You can't afford that.");
  464. }
  465. }
  466. if(listitem == 5) //walkie talkie
  467. {
  468. if(PlayerInfo[playerid][pWT] == 1)
  469. {
  470. SendClientMessage(playerid, COLOR_GREY, "You already have a Walkie Talkie.");
  471. return 1;
  472. }
  473. if(PlayerInfo[playerid][pCash] > 199)
  474. {
  475. GiveMoney(playerid, -200);
  476. DonationIsland += 200;
  477. PlayerInfo[playerid][pWT] = 1;
  478. format(str, sizeof(str), "~r~-$%d", 200);
  479. GameTextForPlayer(playerid, str, 5000, 1);
  480. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  481. SaveHankdata();
  482. }
  483. else
  484. {
  485. return SendClientMessage(playerid, COLOR_GREY, "You can't afford that.");
  486. }
  487. }
  488. if(listitem == 6) //screw drivers
  489. {
  490. if(PlayerInfo[playerid][pScrew] >= 5)
  491. {
  492. SendClientMessage(playerid, COLOR_GREY, "You already have 5 or more screw drivers.");
  493. return 1;
  494. }
  495. if(PlayerInfo[playerid][pCash] > 49)
  496. {
  497. GiveMoney(playerid, -50);
  498. DonationIsland += 50;
  499. PlayerInfo[playerid][pScrew] += 5;
  500. format(str, sizeof(str), "~r~-$%d", 50);
  501. GameTextForPlayer(playerid, str, 5000, 1);
  502. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  503. SaveHankdata();
  504. }
  505. else
  506. {
  507. return SendClientMessage(playerid, COLOR_GREY, "You can't afford that.");
  508. }
  509. }
  510. if(listitem == 7) //blindfolds
  511. {
  512. if(PlayerInfo[playerid][pBlindfolds] >= 6)
  513. {
  514. SendClientMessage(playerid, COLOR_GREY, "You already have 6 or more blindfolds.");
  515. return 1;
  516. }
  517. if(PlayerInfo[playerid][pCash] >= 2000)
  518. {
  519. GiveMoney(playerid, -2000);
  520. DonationIsland += 2000;
  521. PlayerInfo[playerid][pBlindfolds] += 2;
  522. format(str, sizeof(str), "~r~-$%d", 2000);
  523. GameTextForPlayer(playerid, str, 5000, 1);
  524. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  525. SaveHankdata();
  526. }
  527. else
  528. {
  529. return SendClientMessage(playerid, COLOR_GREY, "You can't afford that.");
  530. }
  531. }
  532. if(listitem == 8) //cards
  533. {
  534. if(PlayerInfo[playerid][pCash] >= 1500)
  535. {
  536. GiveMoney(playerid, -1500);
  537. DonationIsland += 1500;
  538. format(str, sizeof(str), "~r~-$%d", 1500);
  539. GameTextForPlayer(playerid, str, 5000, 1);
  540. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  541. PlayerInfo[playerid][pDeck] = 1;
  542. SaveHankdata();
  543. }
  544. else
  545. {
  546. return SendClientMessage(playerid, COLOR_GREY, "You can't afford that.");
  547. }
  548. }
  549. if(listitem == 9)
  550. {
  551. if(PlayerInfo[playerid][pCash] >= 50)
  552. {
  553. GiveMoney(playerid, -50);
  554. DonationIsland += 50;
  555. //GivePlayerGun(playerid, 14); // to be enabled.
  556. format(str, sizeof(str), "~r~-$%d", 50);
  557. GameTextForPlayer(playerid, str, 5000, 1);
  558. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  559. SaveHankdata();
  560. }
  561. else
  562. {
  563. return SendClientMessage(playerid, COLOR_GREY, "You can't afford that.");
  564. }
  565. }
  566. if(listitem == 10) // Stero
  567. {
  568. if(PlayerInfo[playerid][pStereo] > 0) return SendClientMessage(playerid, COLOR_GREY, "You already have a Boombox.");
  569. if(PlayerInfo[playerid][pCash] >= 3000)
  570. {
  571. GiveMoney(playerid, -3000);
  572. DonationIsland += 3000;
  573. PlayerInfo[playerid][pStereo] = 2;
  574. format(str, sizeof(str), "~r~-$%d", 3500);
  575. GameTextForPlayer(playerid, str, 5000, 1);
  576. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  577. SaveHankdata();
  578. }
  579. else
  580. {
  581. return SendClientMessage(playerid, COLOR_GREY, "You can't afford that.");
  582. }
  583. }
  584. if(listitem == 11) //Box of Matches
  585. {
  586. if(PlayerInfo[playerid][pMatches] > 0) return SendClientMessage(playerid, COLOR_GREY, "You can only carry one box of matches.");
  587. if(PlayerInfo[playerid][pCash] >= 250)
  588. {
  589. GiveMoney(playerid, -250);
  590. DonationIsland += 250;
  591. PlayerInfo[playerid][pMatches] = 3;
  592. format(str, sizeof(str), "~r~-$%d", 250);
  593. GameTextForPlayer(playerid, str, 5000, 1);
  594. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  595. SaveHankdata();
  596. }
  597. else
  598. {
  599. return SendClientMessage(playerid, COLOR_GREY, "You can't afford that.");
  600. }
  601. }
  602. if(listitem == 12) //case of beer
  603. {
  604. if(PlayerInfo[playerid][pCash] >= 500)
  605. {
  606. GiveMoney(playerid, -500);
  607. DonationIsland += 500;
  608. PlayerInfo[playerid][pBeer] += 5;
  609. format(str, sizeof(str), "~r~-$%d", 500);
  610. GameTextForPlayer(playerid, str, 5000, 1);
  611. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  612. SaveHankdata();
  613. }
  614. else
  615. {
  616. return SendClientMessage(playerid, COLOR_GREY, "You can't afford that.");
  617. }
  618. }
  619. }
  620. return 1;
  621. }
  622. return 1;
  623. }