Advertisement
Guest User

Untitled

a guest
Feb 20th, 2015
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.25 KB | None | 0 0
  1. /*
  2. Trashcan System (2014)
  3. (c) by Manyula
  4.  
  5. Feel free to edit this filterscript.
  6. */
  7.  
  8. #include <a_samp>
  9.  
  10. #define C_RED 0xFF0000FF
  11. #define C_PINK 0xFF00FFFF
  12.  
  13. #define MINUTES 30 //Edit this define to determine the time in minutes a trashcan can be plundered again
  14.  
  15. #define MAX_TRASH_CANS 89
  16.  
  17. new Float:TrashCans[][] =
  18. {
  19. {2442.1006000, -1759.0000000, 13.4000000, 0.0000000, 0.0000000, 0.0000000}, //object(cj_dumpster) (1)
  20. {2384.4004000, -1941.0996000, 13.3000000, 0.0000000, 0.0000000, 0.0000000}, //object(cj_dumpster) (2)
  21. {2439.3999000, -1901.4000000, 13.3000000, 0.0000000, 0.0000000, 0.0000000}, //object(cj_dumpster) (3)
  22. {2418.3999000, -1577.3000000, 23.5000000, 0.0000000, 0.0000000, 270.0000000}, //object(cj_dumpster) (4)
  23. {2803.5000000, -1195.7000000, 25.3000000, 0.0000000, 0.0000000, 270.0000000}, //object(cj_dumpster) (5)
  24. {2615.3999000, -1391.7000000, 34.5000000, 0.0000000, 0.0000000, 0.0000000}, //object(cj_dumpster) (6)
  25. {2546.6001000, -1289.9000000, 40.9000000, 0.0000000, 0.0000000, 270.0000000}, //object(cj_dumpster) (7)
  26. {2793.1001000, -1626.7000000, 10.7000000, 0.0000000, 0.0000000, 0.0000000}, //object(cj_dumpster) (8)
  27. {2787.2000000, -1427.8000000, 30.2000000, 0.0000000, 0.0000000, 90.0000000}, //object(cj_dumpster) (9)
  28. {2771.0000000, -1374.7000000, 39.4000000, 0.0000000, 0.0000000, 90.0000000}, //object(cj_dumpster) (10)
  29. {2700.8999000, -1107.0000000, 69.3000000, 0.0000000, 0.0000000, 90.0000000}, //object(cj_dumpster) (11)
  30. {2543.8999000, -1120.1000000, 61.7000000, 0.0000000, 0.0000000, 268.0000000}, //object(cj_dumpster) (12)
  31. {2790.7000000, -1095.3000000, 30.5000000, 0.0000000, 0.0000000, 178.0000000}, //object(cj_dumpster) (13)
  32. {2440.9004000, -1963.2002000, 13.3000000, 0.0000000, 0.0000000, 0.0000000}, //object(cj_dumpster) (1)
  33. {2344.8999000, -1949.8000000, 13.3000000, 0.0000000, 0.0000000, 180.0000000}, //object(cj_dumpster) (1)
  34. {2281.2000000, -2047.7000000, 13.3000000, 0.0000000, 0.0000000, 134.9940000}, //object(cj_dumpster) (1)
  35. {2201.2000000, -1967.5000000, 13.8000000, 0.0000000, 0.0000000, 180.4890000}, //object(cj_dumpster) (1)
  36. {1990.2000000, -2013.7000000, 13.3000000, 0.0000000, 0.0000000, 0.4890000}, //object(cj_dumpster) (1)
  37. {2052.3000000, -2145.8000000, 13.4000000, 0.0000000, 0.0000000, 0.4890000}, //object(cj_dumpster) (1)
  38. {2181.8000000, -2250.3000000, 13.1000000, 0.0000000, 0.0000000, 134.4890000}, //object(cj_dumpster) (1)
  39. {2733.8999000, -2446.2000000, 13.4000000, 0.0000000, 0.0000000, 90.4840000}, //object(cj_dumpster) (1)
  40. {2757.0000000, -2020.6000000, 13.3000000, 0.0000000, 0.0000000, 89.9830000}, //object(cj_dumpster) (1)
  41. {2627.7000000, -1985.9000000, 13.3000000, 0.0000000, 0.0000000, 224.2280000}, //object(cj_dumpster) (1)
  42. {2369.3000000, -2032.8000000, 13.3000000, 0.0000000, 0.0000000, 270.2250000}, //object(cj_dumpster) (1)
  43. {2341.6001000, -2153.8000000, 13.3000000, 0.0000000, 0.0000000, 314.9750000}, //object(cj_dumpster) (1)
  44. {2124.0000000, -2281.8000000, 13.2000000, 0.0000000, 0.0000000, 314.9730000}, //object(cj_dumpster) (1)
  45. {2200.1001000, -2631.1001000, 13.3000000, 0.0000000, 0.0000000, 0.4730000}, //object(cj_dumpster) (1)
  46. {2512.6001000, -2640.5000000, 13.4000000, 0.0000000, 0.0000000, 90.4720000}, //object(cj_dumpster) (1)
  47. {2546.1001000, -2355.3000000, 13.4000000, 0.0000000, 0.0000000, 224.4670000}, //object(cj_dumpster) (1)
  48. {1998.7000000, -2135.3999000, 13.3000000, 0.0000000, 0.0000000, 0.4620000}, //object(cj_dumpster) (1)
  49. {1731.2000000, -2054.3000000, 13.3000000, 0.0000000, 0.0000000, 0.4610000}, //object(cj_dumpster) (1)
  50. {1809.6000000, -1687.9000000, 13.3000000, 0.0000000, 0.0000000, 0.4610000}, //object(cj_dumpster) (1)
  51. {1614.6000000, -1842.6000000, 13.3000000, 0.0000000, 0.0000000, 180.0000000}, //object(cj_dumpster) (1)
  52. {1593.4000000, -1785.6000000, 13.1000000, 0.0000000, 0.0000000, 179.9950000}, //object(cj_dumpster) (1)
  53. {1641.3000000, -1678.3000000, 13.3000000, 0.0000000, 0.0000000, 1.0000000}, //object(cj_dumpster) (1)
  54. {1535.0000000, -1849.8000000, 13.3000000, 0.0000000, 0.0000000, 179.9950000}, //object(cj_dumpster) (1)
  55. {1438.0000000, -1847.4000000, 13.3000000, 0.0000000, 0.0000000, 179.9950000}, //object(cj_dumpster) (1)
  56. {1396.8000000, -1893.1000000, 13.3000000, 0.0000000, 0.0000000, 0.0000000}, //object(cj_dumpster) (1)
  57. {1210.9000000, -1877.5000000, 13.3000000, 0.0000000, 0.0000000, 270.0000000}, //object(cj_dumpster) (1)
  58. {1118.8000000, -1780.7000000, 13.4000000, 0.0000000, 0.0000000, 270.0000000}, //object(cj_dumpster) (1)
  59. {1229.1000000, -1608.4000000, 13.3000000, 0.0000000, 0.0000000, 0.0000000}, //object(cj_dumpster) (1)
  60. {1083.8000000, -1668.1000000, 13.4000000, 0.0000000, 0.0000000, 180.0000000}, //object(cj_dumpster) (1)
  61. {963.0999800, -1727.8000000, 13.3000000, 0.0000000, 0.0000000, 179.9950000}, //object(cj_dumpster) (1)
  62. {953.0999800, -1605.8000000, 13.3000000, 0.0000000, 0.0000000, 0.0000000}, //object(cj_dumpster) (1)
  63. {858.0000000, -1553.8000000, 13.3000000, 0.0000000, 0.0000000, 180.0000000}, //object(cj_dumpster) (1)
  64. {706.9000200, -1473.2000000, 5.2000000, 0.0000000, 0.0000000, 0.0000000}, //object(cj_dumpster) (1)
  65. {587.5999800, -1555.9000000, 15.4000000, 0.0000000, 0.0000000, 180.0000000}, //object(cj_dumpster) (1)
  66. {2383.8999000, -1486.1000000, 23.8000000, 0.0000000, 0.0000000, 90.0000000}, //object(cj_dumpster) (1)
  67. {2246.5000000, -1155.0000000, 25.6000000, 0.0000000, 0.0000000, 180.0000000}, //object(cj_dumpster) (1)
  68. {2123.5000000, -1196.0000000, 23.7000000, 0.0000000, 0.0000000, 179.9950000}, //object(cj_dumpster) (1)
  69. {2209.3000000, -1345.0000000, 23.8000000, 0.0000000, 0.0000000, 179.9950000}, //object(cj_dumpster) (1)
  70. {2004.2000000, -1550.7000000, 13.4000000, 0.0000000, 0.0000000, 334.7450000}, //object(cj_dumpster) (1)
  71. {1907.7000000, -1574.0000000, 13.4000000, 0.0000000, 0.0000000, 180.7420000}, //object(cj_dumpster) (1)
  72. {1611.7000000, -1200.3000000, 19.6000000, 0.0000000, 0.0000000, 0.7360000}, //object(cj_dumpster) (1)
  73. {1437.5000000, -1323.5000000, 13.3000000, 0.0000000, 0.0000000, 0.7360000}, //object(cj_dumpster) (1)
  74. {1360.7000000, -1520.3000000, 13.3000000, 0.0000000, 0.0000000, 345.2360000}, //object(cj_dumpster) (1)
  75. {1341.7000000, -1681.1000000, 13.4000000, 0.0000000, 0.0000000, 89.2340000}, //object(cj_dumpster) (1)
  76. {1593.3000000, -1559.9000000, 13.9000000, 0.0000000, 0.0000000, 90.7310000}, //object(cj_dumpster) (1)
  77. {1830.3000000, -1150.5000000, 23.6000000, 0.0000000, 0.0000000, 180.2310000}, //object(cj_dumpster) (1)
  78. {2059.0000000, -1049.1000000, 26.9000000, 0.0000000, 355.0000000, 338.2250000}, //object(cj_dumpster) (1)
  79. {2120.8999000, -1062.3000000, 25.0000000, 0.0000000, 0.0000000, 238.2250000}, //object(cj_dumpster) (1)
  80. {1722.2000000, -1472.5000000, 13.3000000, 0.0000000, 0.0000000, 269.7220000}, //object(cj_dumpster) (1)
  81. {1628.8000000, -1911.3000000, 13.3000000, 0.0000000, 0.0000000, 89.7200000}, //object(cj_dumpster) (1)
  82. {1372.4000000, -1721.1000000, 12.9000000, 0.0000000, 0.0000000, 180.2200000}, //object(cj_dumpster) (1)
  83. {2593.0000000, -1321.3000000, 39.3000000, 0.0000000, 9.0000000, 270.2200000}, //object(cj_dumpster) (1)
  84. {857.5000000, -975.5000000, 35.3000000, 0.0000000, 3.0000000, 210.0000000}, //object(cj_dumpster) (5)
  85. {2449.1001000, -2542.8000000, 13.4000000, 0.0000000, 0.0000000, 90.0000000}, //object(cj_dumpster) (14)
  86. {2199.8999000, -2601.8000000, 13.3000000, 0.0000000, 0.0000000, 180.0000000}, //object(cj_dumpster) (15)
  87. {1337.1000000, -1819.9000000, 13.3000000, 0.0000000, 0.0000000, 89.9950000}, //object(cj_dumpster) (16)
  88. {1424.5000000, -1357.0000000, 13.3000000, 0.0000000, 0.0000000, 179.9950000}, //object(cj_dumpster) (17)
  89. {1284.8000000, -1253.6000000, 13.3000000, 0.0000000, 0.0000000, 179.9950000}, //object(cj_dumpster) (18)
  90. {1201.9000000, -975.9000200, 43.2000000, 0.0000000, 0.0000000, 359.9950000}, //object(cj_dumpster) (20)
  91. {1015.8000000, -1004.2000000, 31.9000000, 0.0000000, 0.0000000, 359.9890000}, //object(cj_dumpster) (21)
  92. {811.7000100, -1268.2000000, 13.4000000, 0.0000000, 0.0000000, 359.9890000}, //object(cj_dumpster) (22)
  93. {777.4000200, -1120.6000000, 23.6000000, 0.0000000, 0.0000000, 359.9890000}, //object(cj_dumpster) (23)
  94. {783.7999900, -1012.6000000, 26.1000000, 0.0000000, 0.0000000, 356.4890000}, //object(cj_dumpster) (24)
  95. {732.7999900, -1337.3000000, 13.3000000, 0.0000000, 0.0000000, 90.4840000}, //object(cj_dumpster) (25)
  96. {1031.3000000, -1363.8000000, 13.3000000, 0.0000000, 0.0000000, 270.2330000}, //object(cj_dumpster) (27)
  97. {1011.9000000, -1270.4000000, 15.0000000, 0.0000000, 0.0000000, 270.2310000}, //object(cj_dumpster) (28)
  98. {876.4000200, -1363.6000000, 13.3000000, 0.0000000, 0.0000000, 90.2310000}, //object(cj_dumpster) (29)
  99. {996.0000000, -1521.0000000, 13.3000000, 0.0000000, 0.0000000, 270.2250000}, //object(cj_dumpster) (30)
  100. {410.6000100, -1808.9000000, 5.3000000, 0.0000000, 0.0000000, 90.2200000}, //object(cj_dumpster) (31)
  101. {1083.9000000, -1223.4000000, 15.6000000, 0.0000000, 0.0000000, 0.2140000}, //object(cj_dumpster) (32)
  102. {1132.9000000, -1346.2000000, 13.8000000, 0.0000000, 0.0000000, 180.2090000}, //object(cj_dumpster) (33)
  103. {311.7999900, -1435.7000000, 27.7000000, 0.0000000, 0.0000000, 304.9530000}, //object(cj_dumpster) (34)
  104. {413.3999900, -1305.4000000, 14.7000000, 0.0000000, 0.0000000, 213.7030000}, //object(cj_dumpster) (35)
  105. {1297.9000000, -979.0000000, 32.5000000, 0.0000000, 0.0000000, 270.2010000}, //object(cj_dumpster) (36)
  106. {1615.5000000, -992.5000000, 23.8000000, 0.0000000, 0.0000000, 20.1980000}, //object(cj_dumpster) (37)
  107. {1964.7000000, -1306.4000000, 23.5000000, 0.0000000, 351.5000000, 0.1930000} //object(cj_dumpster)
  108. };
  109.  
  110. new TrashCans_ID[MAX_TRASH_CANS] = {-1,...};
  111. new TrashCans_InteractionField[MAX_TRASH_CANS] = {-1,...};
  112. new PlayerText:TrashcanNotification[MAX_PLAYERS][4];
  113. new CurrentTrashcanArea[MAX_PLAYERS] = {-1,...};
  114.  
  115. public OnFilterScriptInit()
  116. {
  117. for(new i = 0; i < MAX_TRASH_CANS; i++)
  118. {
  119. TrashCans_ID[i] = CreateDynamicObject(1345, TrashCans[i][0], TrashCans[i][1], TrashCans[i][2] , TrashCans[i][3], TrashCans[i][4], TrashCans[i][5], 0, -1);
  120. TrashCans_InteractionField[i] = CreateDynamicSphere(TrashCans[i][0], TrashCans[i][1], TrashCans[i][2], 4.0, 0, 0, -1);
  121. }
  122. return 1;
  123. }
  124.  
  125. public OnPlayerConnect(playerid)
  126. {
  127. TrashcanNotification[playerid][0] = CreatePlayerTextDraw(playerid, 487.999969, 333.766662, "MuelleimerBenachrichtigungGroßBox");
  128. PlayerTextDrawLetterSize(playerid, TrashcanNotification[playerid][0], 0.000000, 5.083744);
  129. PlayerTextDrawTextSize(playerid, TrashcanNotification[playerid][0], 379.000000, 0.000000);
  130. PlayerTextDrawAlignment(playerid, TrashcanNotification[playerid][0], 1);
  131. PlayerTextDrawColor(playerid, TrashcanNotification[playerid][0], 0);
  132. PlayerTextDrawUseBox(playerid, TrashcanNotification[playerid][0], true);
  133. PlayerTextDrawBoxColor(playerid, TrashcanNotification[playerid][0], 102);
  134. PlayerTextDrawSetShadow(playerid, TrashcanNotification[playerid][0], 0);
  135. PlayerTextDrawSetOutline(playerid, TrashcanNotification[playerid][0], 0);
  136. PlayerTextDrawFont(playerid, TrashcanNotification[playerid][0], 0);
  137.  
  138. TrashcanNotification[playerid][1] = CreatePlayerTextDraw(playerid, 487.666625, 333.766632, "MuelleimerBenachrichtigungKleineBox");
  139. PlayerTextDrawLetterSize(playerid, TrashcanNotification[playerid][1], 0.000000, 0.945475);
  140. PlayerTextDrawTextSize(playerid, TrashcanNotification[playerid][1], 379.333312, 0.000000);
  141. PlayerTextDrawAlignment(playerid, TrashcanNotification[playerid][1], 1);
  142. PlayerTextDrawColor(playerid, TrashcanNotification[playerid][1], 0);
  143. PlayerTextDrawUseBox(playerid, TrashcanNotification[playerid][1], true);
  144. PlayerTextDrawBoxColor(playerid, TrashcanNotification[playerid][1], 102);
  145. PlayerTextDrawSetShadow(playerid, TrashcanNotification[playerid][1], 0);
  146. PlayerTextDrawSetOutline(playerid, TrashcanNotification[playerid][1], 0);
  147. PlayerTextDrawFont(playerid, TrashcanNotification[playerid][1], 0);
  148.  
  149. TrashcanNotification[playerid][2] = CreatePlayerTextDraw(playerid, 381.999908, 332.266662, "Muelleimer");
  150. PlayerTextDrawLetterSize(playerid, TrashcanNotification[playerid][2], 0.195333, 1.164443);
  151. PlayerTextDrawAlignment(playerid, TrashcanNotification[playerid][2], 1);
  152. PlayerTextDrawColor(playerid, TrashcanNotification[playerid][2], -5963521);
  153. PlayerTextDrawSetShadow(playerid, TrashcanNotification[playerid][2], 0);
  154. PlayerTextDrawSetOutline(playerid, TrashcanNotification[playerid][2], 1);
  155. PlayerTextDrawBackgroundColor(playerid, TrashcanNotification[playerid][2], 51);
  156. PlayerTextDrawFont(playerid, TrashcanNotification[playerid][2], 2);
  157. PlayerTextDrawSetProportional(playerid, TrashcanNotification[playerid][2], 1);
  158.  
  159. TrashcanNotification[playerid][3] = CreatePlayerTextDraw(playerid, 383.333343, 344.711120, Druecke~r~~k~~SNEAK_ABOUT~ ~w~um~n~zu interagieren mit~n~ader Muelltonne.");
  160. PlayerTextDrawLetterSize(playerid, TrashcanNotification[playerid][3], 0.197999, 1.127110);
  161. PlayerTextDrawAlignment(playerid, TrashcanNotification[playerid][3], 1);
  162. PlayerTextDrawColor(playerid, TrashcanNotification[playerid][3], -1);
  163. PlayerTextDrawSetShadow(playerid, TrashcanNotification[playerid][3], 0);
  164. PlayerTextDrawSetOutline(playerid, TrashcanNotification[playerid][3], 1);
  165. PlayerTextDrawBackgroundColor(playerid, TrashcanNotification[playerid][3], 51);
  166. PlayerTextDrawFont(playerid, TrashcanNotification[playerid][3], 2);
  167. PlayerTextDrawSetProportional(playerid, TrashcanNotification[playerid][3], 1);
  168. return 1;
  169. }
  170.  
  171. //==================================================================================================================================================================================================================================
  172.  
  173. new bool:Searching[MAX_PLAYERS] = false;
  174. new TrashCanLootTimer[MAX_PLAYERS];
  175.  
  176. new TrashCan_Items[][] =
  177. {
  178. {"eine teilweise gebrochenes Medikit"},
  179. {"eine teilweise beschädigte Rüstung"},
  180. {"ein halbes Brot"},
  181. {"ein Stück Brot"},
  182. {"eine halbvolle Flasche Wasser"},
  183. {"eine volle Flasche Wasser"},
  184. {"ein Energy-Drink"},
  185. {"ein alkoholfreies Getränk"},
  186. {"eine halbe Gurke"},
  187. {"eine Gurke"},
  188. {"eine halbe Karotte"},
  189. {"eine Karotte"},
  190. {"eine Ratte"},
  191. {"eine Schlange"},
  192. {"eine Tarantula"},
  193. {"ein Scorpion"},
  194. {"eine Granate"},
  195. {"ein wenig Geld"},
  196. {"sehr viel Geld"},
  197. {"ein Baseball-Schläger "},
  198. {"ein Katana-Schwert"},
  199. {"ein Golfschläger"},
  200. {"ein Schleimiger Dildo"}
  201. };
  202.  
  203. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  204. {
  205. if(newkeys & KEY_WALK)
  206. {
  207. if(CurrentTrashcanArea[playerid] != -1)
  208. {
  209. if(IsPlayerInDynamicArea(TrashCans_InteractionField[CurrentTrashcanArea[playerid]]))
  210. {
  211. if(!Searching[playerid])
  212. {
  213. if(gettime() < TrashCans_ID[CurrentTrashcanArea[playerid]])
  214. {
  215. new stringEN[128];
  216. format(stringEN, sizeof(stringEN), "»WARNUNG« Dieser Mülleimer wurde bereits entleert. Versuche es erneut in %i Minuten.", (TrashCans_ID[CurrentTrashcanArea[playerid]] - gettime())/60);
  217. return SendClientMessage(playerid, C_RED, stringEN);
  218. }
  219. TrashCanLootTimer[playerid] = SetTimerEx("TrashCanLoot", 4000, false, "ii", playerid, CurrentTrashcanArea[playerid]);
  220. ApplyAnimation(playerid, "BD_FIRE", "BD_Panic_Loop", 4.1, 0, 0, 0, 0, 4000, 1);
  221. SendClientMessage(playerid, C_PINK, "»Spieler« Du durchwühlst den Mülleimer...");
  222. Searching[playerid] = true;
  223. }
  224. else if(Searching[playerid])
  225. {
  226. TrashCans_ID[CurrentTrashcanArea[playerid]] = -1;
  227. SendClientMessage(playerid, C_RED, "»WARNUNG« Du hast aufgehört, den Mülleimer zu durchwühlen.");
  228. ClearAnimations(playerid);
  229. KillTimer(TrashCanLootTimer[playerid]);
  230. Searching[playerid] = false;
  231. }
  232. }
  233. }
  234. }
  235. return 1;
  236. }
  237.  
  238. //==================================================================================================================================================================================================================================
  239.  
  240. forward TrashCanLoot(playerid, i);
  241. public TrashCanLoot(playerid, i)
  242. {
  243. ClearAnimations(playerid);
  244. Searching[playerid] = false;
  245. TrashCans_ID[i] = gettime() + MINUTES*60;
  246.  
  247. new stringEN[64],
  248. Random = random(sizeof(TrashCan_Items));
  249. format(stringEN, sizeof(stringEN), "»SPIELER« Du hast %s gefunden!", TrashCan_Items[Random][0]);
  250. SendClientMessage(playerid, C_PINK, stringEN);
  251.  
  252. new Float:HP,
  253. Float:AP,
  254. rMoney1 = random(499) + 100,
  255. rMoney2 = random(1999) + 1000;
  256. GetPlayerHealth(playerid, HP);
  257. GetPlayerArmour(playerid, AP);
  258.  
  259. switch(Random)
  260. {
  261. case 0:
  262. {
  263. new RandomHP = random(15) + 5;
  264. if((HP + RandomHP) > 100) return SetPlayerHealth(playerid, 100);
  265. SetPlayerHealth(playerid, HP + RandomHP); //Medikit
  266. }
  267. case 1:
  268. {
  269. new RandomAP = random(15) + 5;
  270. if((AP + RandomAP) > 100) return SetPlayerArmour(playerid, 100);
  271. SetPlayerArmour(playerid, AP + RandomAP); //Armor
  272. }
  273. case 2:
  274. {
  275. if((HP + 7) > 100) return SetPlayerHealth(playerid, 100);
  276. SetPlayerHealth(playerid, HP + 10); //half a bread
  277. }
  278. case 3:
  279. {
  280. if((HP + 14) > 100) return SetPlayerHealth(playerid, 100);
  281. SetPlayerHealth(playerid, HP + 20); //piece of bread
  282. }
  283. case 4:
  284. {
  285. if((HP + 5) > 100) return SetPlayerHealth(playerid, 100);
  286. SetPlayerHealth(playerid, HP + 9); //half a bottle of water
  287. }
  288. case 5:
  289. {
  290. if((HP + 10) > 100) return SetPlayerHealth(playerid, 100);
  291. SetPlayerHealth(playerid, HP + 18); //bottle of water
  292. }
  293. case 6:
  294. {
  295. if((HP + 13) > 100) return SetPlayerHealth(playerid, 100);
  296. SetPlayerHealth(playerid, HP + 15); //energy drink
  297. }
  298. case 7:
  299. {
  300. if((HP + 12) > 100) return SetPlayerHealth(playerid, 100);
  301. SetPlayerHealth(playerid, HP + 12); //soft drink
  302. }
  303. case 8:
  304. {
  305. if((HP + 8) > 100) return SetPlayerHealth(playerid, 100);
  306. SetPlayerHealth(playerid, HP + 8); //half a cucumber
  307. }
  308. case 9:
  309. {
  310. if((HP + 16) > 100) return SetPlayerHealth(playerid, 100);
  311. SetPlayerHealth(playerid, HP + 16); //cucumber
  312. }
  313. case 10:
  314. {
  315. if((HP + 4) > 100) return SetPlayerHealth(playerid, 100);
  316. SetPlayerHealth(playerid, HP + 6); //half a carrot
  317. }
  318. case 11:
  319. {
  320. if((HP + 8) > 100) return SetPlayerHealth(playerid, 100);
  321. SetPlayerHealth(playerid, HP + 11); //carrot
  322. }
  323. case 12: SetPlayerHealth(playerid, HP - 12); //rat
  324. case 13: SetPlayerHealth(playerid, HP - 19); //snake
  325. case 14: SetPlayerHealth(playerid, HP - 21); //tarantula
  326. case 15: SetPlayerHealth(playerid, HP - 22); //scorpion
  327. case 16: CreateExplosion(TrashCans[i][0], TrashCans[i][1], TrashCans[i][2], 0, 2.0); //grenade
  328. case 17: GivePlayerMoney(playerid, rMoney1); //few money
  329. case 18: GivePlayerMoney(playerid, rMoney2); //much money
  330. case 19: GivePlayerWeapon(playerid, 5, 1); //baseball bat
  331. case 20: GivePlayerWeapon(playerid, 8, 1); //katana
  332. case 21: GivePlayerWeapon(playerid, 2, 1); //golf club
  333. case 22: GivePlayerWeapon(playerid, 11, 1); //dildo
  334. }
  335. return 1;
  336. }
  337.  
  338. //==================================================================================================================================================================================================================================
  339.  
  340. forward OnPlayerEnterDynamicArea(playerid, areaid);
  341. public OnPlayerEnterDynamicArea(playerid, areaid)
  342. {
  343. for(new i = 0; i < MAX_TRASH_CANS; i++)
  344. {
  345. if(areaid == TrashCans_InteractionField[i])
  346. {
  347. CurrentTrashcanArea[playerid] = i;
  348. PlayerTextDrawShow(playerid, TrashcanNotification[playerid][0]);
  349. PlayerTextDrawShow(playerid, TrashcanNotification[playerid][1]);
  350. PlayerTextDrawShow(playerid, TrashcanNotification[playerid][2]);
  351. PlayerTextDrawShow(playerid, TrashcanNotification[playerid][3]);
  352. PlayerPlaySound(playerid, 1138, 0.0, 0.0, 0.0);
  353. }
  354. }
  355. return 1;
  356. }
  357.  
  358. //==================================================================================================================================================================================================================================
  359.  
  360. forward OnPlayerLeaveDynamicArea(playerid, areaid);
  361. public OnPlayerLeaveDynamicArea(playerid, areaid)
  362. {
  363. for(new i = 0; i < MAX_TRASH_CANS; i++)
  364. {
  365. if(areaid == TrashCans_InteractionField[i])
  366. {
  367. CurrentTrashcanArea[playerid] = -1;
  368. PlayerTextDrawHide(playerid, TrashcanNotification[playerid][0]);
  369. PlayerTextDrawHide(playerid, TrashcanNotification[playerid][1]);
  370. PlayerTextDrawHide(playerid, TrashcanNotification[playerid][2]);
  371. PlayerTextDrawHide(playerid, TrashcanNotification[playerid][3]);
  372. }
  373. }
  374. return 1;
  375. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement