Guest User

mp

a guest
Mar 18th, 2017
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.08 KB | None | 0 0
  1. /*
  2. Megafone para veículos de polícia.
  3. por Jelly23.
  4.  
  5. 12/03/2017 - 20:24
  6. */
  7.  
  8. /*IDs*/
  9. #define MEGAFONE_MAVERICK (1)
  10. #define MEGAFONE_PREDATOR (2)
  11. #define MEGAFONE_CARRO (3)
  12.  
  13. /*Uso de foreach*/
  14. #define USAR_FOREACH (true)
  15.  
  16. /*TextDraws e arrays*/
  17. static
  18. Text:Mega_Fone[5] = Text:INVALID_TEXT_DRAW,
  19. PlayerText:Mega_FoneString = PlayerText:INVALID_TEXT_DRAW,
  20. bool:EstaUsandoMegafone[MAX_PLAYERS],
  21. bool:TextDrawsCriadas[MAX_PLAYERS],
  22. SomAtual[MAX_PLAYERS],
  23.  
  24. /*Sons*/
  25. Megafone[][] = //id de som, string e id de megafone.
  26. {
  27. //Maverick
  28. {15800, "This is Los Santos Police Department...",MEGAFONE_MAVERICK},
  29. {56831, "We've got a visual on the suspect!",MEGAFONE_MAVERICK},
  30. {56832, "We've got a clear shot on the suspect...",MEGAFONE_MAVERICK},
  31. {56833, "Put your hands up, it's over!",MEGAFONE_MAVERICK},
  32. {56834, "Stop!",MEGAFONE_MAVERICK},
  33. {56835, "Hover it steady! Now shoot him on...",MEGAFONE_MAVERICK},
  34. {56836, "Give up! The game's up",MEGAFONE_MAVERICK},
  35. {56837, "This is aerial support, we've got...",MEGAFONE_MAVERICK},
  36. {56838, "I've got a headshot on you, tough...",MEGAFONE_MAVERICK},
  37. {56839, "We've got a clear visual on the...",MEGAFONE_MAVERICK},
  38. {56840, "Suspect is about to be terminated!",MEGAFONE_MAVERICK},
  39. {56841, "You are going down, hard man...",MEGAFONE_MAVERICK},
  40. {56842, "We've got a clear on the sighting...",MEGAFONE_MAVERICK},
  41. {56843, "I see her! She is beautiful...",MEGAFONE_MAVERICK},
  42. {56844, "Playtime is over kid! Oh, you're...",MEGAFONE_MAVERICK},
  43. {56845, "Jim, you've seen anything?...",MEGAFONE_MAVERICK},
  44. {56846, "Hey, I can see my house from here!...",MEGAFONE_MAVERICK},
  45. {56847, "SHOOT THAT ASSHOLE! I'm trying...",MEGAFONE_MAVERICK},
  46. {56848, "Why do i've to do all the shooting?...",MEGAFONE_MAVERICK},
  47. {56849, "We've got a clear sighting on our...",MEGAFONE_MAVERICK},
  48. {56850, "We can feel this guy blow a hole!",MEGAFONE_MAVERICK},
  49. {56851, "This is heli support. I'm about...",MEGAFONE_MAVERICK},
  50. {56852, "You! Stop! Or we will kill you!",MEGAFONE_MAVERICK},
  51. {56853, "You can't escape it, Asshole!",MEGAFONE_MAVERICK},
  52. {56854, "We're the police, moron, we...",MEGAFONE_MAVERICK},
  53. {56855, "You! Stop running! Now!",MEGAFONE_MAVERICK},
  54. {56856, "It's time to shut you up, asshole!",MEGAFONE_MAVERICK},
  55. {56857, "This is aerial support, suspect...",MEGAFONE_MAVERICK},
  56. {56858, "You're about to get taught...",MEGAFONE_MAVERICK},
  57. {56859, "Suspect is trying to escape!...",MEGAFONE_MAVERICK},
  58. {56860, "Suspect is escaping! Repeat: escaping!",MEGAFONE_MAVERICK},
  59. {56861, "This is helicopter support, we're...",MEGAFONE_MAVERICK},
  60. {56862, "This is chopper support, suspect in...",MEGAFONE_MAVERICK},
  61. {56863, "You're in trouble now, bad boy!",MEGAFONE_MAVERICK},
  62. {56864, "You're trying to screw up...",MEGAFONE_MAVERICK},
  63. {56865, "WE are the good guys, you little...",MEGAFONE_MAVERICK},
  64. {56866, "You still think you are hard, huh?",MEGAFONE_MAVERICK},
  65. {56867, "Suspect is about to be apprehended...",MEGAFONE_MAVERICK},
  66. {56868, "This is the aerial unit, we've got...",MEGAFONE_MAVERICK},
  67. {56869, "You're mine, tough guy!",MEGAFONE_MAVERICK},
  68. {56870, "Look at the birdie! It's dying...",MEGAFONE_MAVERICK},
  69. {56871, "This little party is about to get...",MEGAFONE_MAVERICK},
  70. {56872, "Oh, you can stop running now, sus...",MEGAFONE_MAVERICK},
  71. {56873, "Man, stop photographing those wom...",MEGAFONE_MAVERICK},
  72. {56874, "Where is he? Over there you dick...",MEGAFONE_MAVERICK},
  73. {56875, "Stop! Now! Right now! Just shoot him!",MEGAFONE_MAVERICK},
  74. {56876, "I'm going to kill this guy! Make...",MEGAFONE_MAVERICK},
  75. {56877, "You! Stop! Just shoot him, you pussy!",MEGAFONE_MAVERICK},
  76. {56878, "Hey! If i kill him, do I get a medal?",MEGAFONE_MAVERICK},
  77. {56879, "There is he, kill him! John, why...",MEGAFONE_MAVERICK},
  78. {56880, "This is aerial support... I think...",MEGAFONE_MAVERICK},
  79. //Predator
  80. {56800, "This is the coast guard, stop your...",MEGAFONE_PREDATOR},
  81. {56801, "Police! Stop! it will spoil your..",MEGAFONE_PREDATOR},
  82. {56802, "Stop your vessel, tough guy!",MEGAFONE_PREDATOR},
  83. {56803, "Vessel, this is San Andreas...",MEGAFONE_PREDATOR},
  84. {56804, "Vessel, What are your intentions?",MEGAFONE_PREDATOR},
  85. {56805, "You! Stop your fucking boat!",MEGAFONE_PREDATOR},
  86. {56806, "Stop that boat, now!",MEGAFONE_PREDATOR},
  87. {56807, "We'll intercept your vessel, stop.",MEGAFONE_PREDATOR},
  88. {56808, "Stop!",MEGAFONE_PREDATOR},
  89. {56809, "You! Stop your vessel now!",MEGAFONE_PREDATOR},
  90. {56810, "Just stop wise guy, before we...",MEGAFONE_PREDATOR},
  91. {56811, "You are getting to stop now!",MEGAFONE_PREDATOR},
  92. {56812, "Stop or we'll open fire in your...",MEGAFONE_PREDATOR},
  93. {56813, "This is the coast guard, stop...",MEGAFONE_PREDATOR},
  94. {56814, "Hey, You! This is the coast guard..",MEGAFONE_PREDATOR},
  95. {56815, "You! In that boat! Stop! Now!",MEGAFONE_PREDATOR},
  96. {56816, "This is the coast guard! We...",MEGAFONE_PREDATOR},
  97. {56817, "You are getting yourself in...",MEGAFONE_PREDATOR},
  98. {56818, "This is the San Andreas Coast...",MEGAFONE_PREDATOR},
  99. {56819, "You think we can't see you, dip..",MEGAFONE_PREDATOR},
  100. {56820, "Hey guy! I'm gonna make this quic..",MEGAFONE_PREDATOR},
  101. {56821, "Hey you! Stop right now!",MEGAFONE_PREDATOR},
  102. {56822, "This is the coast guard, asshole...",MEGAFONE_PREDATOR},
  103. {56823, "We want to make a...",MEGAFONE_PREDATOR},
  104. {56824, "Declare your attention, or we'll...",MEGAFONE_PREDATOR},
  105. {56825, "Tough guy! This is the coast guard..",MEGAFONE_PREDATOR},
  106. {56826, "Stop! This guy is really annoying...",MEGAFONE_PREDATOR},
  107. {56827, "Asshole, stop! Or you will get...",MEGAFONE_PREDATOR},
  108. {56828, "Hey, you! This is the coast guard...",MEGAFONE_PREDATOR},
  109. {56829, "There he is, there he is! You, stop!",MEGAFONE_PREDATOR},
  110. //Carro
  111. {56882, "I see you! You are trying some way!",MEGAFONE_CARRO},
  112. {56883, "You! Get out right now!",MEGAFONE_CARRO},
  113. {56884, "We're gonna flip you, tough guy!",MEGAFONE_CARRO},
  114. {56885, "You really wanna drive? Uh?",MEGAFONE_CARRO},
  115. {56886, "We got a suspect in the water...",MEGAFONE_CARRO},
  116. {56890, "You can't escape!",MEGAFONE_CARRO},
  117. {56904, "Give up! You dumb moron!",MEGAFONE_CARRO},
  118. {56906, "C'mon! Get outta there, asshole!",MEGAFONE_CARRO},
  119. {56907, "You ain't going nowhere, we got..",MEGAFONE_CARRO}
  120. };
  121.  
  122. #if defined FILTERSCRIPT
  123.  
  124. public OnFilterScriptInit()
  125. {
  126. /*TextDraws*/
  127. Mega_Fone[0] = TextDrawCreate(12.000000, 225.000000, "box");
  128. TextDrawLetterSize(Mega_Fone[0], 0.000000, 10.616493);
  129. TextDrawTextSize(Mega_Fone[0], 203.000000, 0.000000);
  130. TextDrawAlignment(Mega_Fone[0], 1);
  131. TextDrawColor(Mega_Fone[0], -1);
  132. TextDrawUseBox(Mega_Fone[0], 1);
  133. TextDrawBoxColor(Mega_Fone[0], 120);
  134. TextDrawSetShadow(Mega_Fone[0], 0);
  135. TextDrawSetOutline(Mega_Fone[0], 0);
  136. TextDrawBackgroundColor(Mega_Fone[0], 255);
  137. TextDrawFont(Mega_Fone[0], 1);
  138. TextDrawSetProportional(Mega_Fone[0], 1);
  139. TextDrawSetShadow(Mega_Fone[0], 0);
  140.  
  141. Mega_Fone[1] = TextDrawCreate(12.000000, 225.000000, "box");
  142. TextDrawLetterSize(Mega_Fone[1], 0.000000, 0.626500);
  143. TextDrawTextSize(Mega_Fone[1], 202.930282, 0.000000);
  144. TextDrawAlignment(Mega_Fone[1], 1);
  145. TextDrawColor(Mega_Fone[1], -1);
  146. TextDrawUseBox(Mega_Fone[1], 1);
  147. TextDrawBoxColor(Mega_Fone[1], 255);
  148. TextDrawSetShadow(Mega_Fone[1], 0);
  149. TextDrawSetOutline(Mega_Fone[1], 0);
  150. TextDrawBackgroundColor(Mega_Fone[1], 255);
  151. TextDrawFont(Mega_Fone[1], 1);
  152. TextDrawSetProportional(Mega_Fone[1], 1);
  153. TextDrawSetShadow(Mega_Fone[1], 0);
  154.  
  155. Mega_Fone[2] = TextDrawCreate(70.399978, 221.600006, "Megafone");
  156. TextDrawLetterSize(Mega_Fone[2], 0.326624, 1.110832);
  157. TextDrawAlignment(Mega_Fone[2], 1);
  158. TextDrawColor(Mega_Fone[2], -1);
  159. TextDrawSetShadow(Mega_Fone[2], 0);
  160. TextDrawSetOutline(Mega_Fone[2], 1);
  161. TextDrawBackgroundColor(Mega_Fone[2], 255);
  162. TextDrawFont(Mega_Fone[2], 1);
  163. TextDrawSetProportional(Mega_Fone[2], 1);
  164. TextDrawSetShadow(Mega_Fone[2], 0);
  165.  
  166. Mega_Fone[3] = TextDrawCreate(16.799995, 243.600006, "box");
  167. TextDrawLetterSize(Mega_Fone[3], 0.000000, 0.812500);
  168. TextDrawTextSize(Mega_Fone[3], 197.800018, 0.000000);
  169. TextDrawAlignment(Mega_Fone[3], 1);
  170. TextDrawColor(Mega_Fone[3], -1);
  171. TextDrawUseBox(Mega_Fone[3], 1);
  172. TextDrawBoxColor(Mega_Fone[3], -136);
  173. TextDrawSetShadow(Mega_Fone[3], 0);
  174. TextDrawSetOutline(Mega_Fone[3], 0);
  175. TextDrawBackgroundColor(Mega_Fone[3], 255);
  176. TextDrawFont(Mega_Fone[3], 1);
  177. TextDrawSetProportional(Mega_Fone[3], 1);
  178. TextDrawSetShadow(Mega_Fone[3], 0);
  179.  
  180. Mega_Fone[4] = TextDrawCreate(46.199996, 298.999633, "Y_-_N_para_CIMA/BAIXO.~n~CTRL_seleciona.");
  181. TextDrawLetterSize(Mega_Fone[4], 0.286874, 1.249999);
  182. TextDrawAlignment(Mega_Fone[4], 1);
  183. TextDrawColor(Mega_Fone[4], -5963521);
  184. TextDrawSetShadow(Mega_Fone[4], 0);
  185. TextDrawSetOutline(Mega_Fone[4], 1);
  186. TextDrawBackgroundColor(Mega_Fone[4], 255);
  187. TextDrawFont(Mega_Fone[4], 1);
  188. TextDrawSetProportional(Mega_Fone[4], 1);
  189. TextDrawSetShadow(Mega_Fone[4], 0);
  190.  
  191. #if defined J_OnFilterScriptInit
  192. return J_OnFilterScriptInit();
  193. #else
  194. return 1;
  195. #endif
  196. }
  197.  
  198. public OnFilterScriptExit()
  199. {
  200. TextDrawDestroy(Mega_Fone[0]);
  201. TextDrawDestroy(Mega_Fone[1]);
  202. TextDrawDestroy(Mega_Fone[2]);
  203. TextDrawDestroy(Mega_Fone[3]);
  204. TextDrawDestroy(Mega_Fone[4]);
  205.  
  206. #if defined J_OnFilterScriptExit
  207. return J_OnFilterScriptExit();
  208. #else
  209. return 1;
  210. #endif
  211. }
  212.  
  213. #else
  214.  
  215. public OnGameModeInit()
  216. {
  217. /*TextDraws*/
  218. Mega_Fone[0] = TextDrawCreate(12.000000, 225.000000, "box");
  219. TextDrawLetterSize(Mega_Fone[0], 0.000000, 10.616493);
  220. TextDrawTextSize(Mega_Fone[0], 203.000000, 0.000000);
  221. TextDrawAlignment(Mega_Fone[0], 1);
  222. TextDrawColor(Mega_Fone[0], -1);
  223. TextDrawUseBox(Mega_Fone[0], 1);
  224. TextDrawBoxColor(Mega_Fone[0], 120);
  225. TextDrawSetShadow(Mega_Fone[0], 0);
  226. TextDrawSetOutline(Mega_Fone[0], 0);
  227. TextDrawBackgroundColor(Mega_Fone[0], 255);
  228. TextDrawFont(Mega_Fone[0], 1);
  229. TextDrawSetProportional(Mega_Fone[0], 1);
  230. TextDrawSetShadow(Mega_Fone[0], 0);
  231.  
  232. Mega_Fone[1] = TextDrawCreate(12.000000, 225.000000, "box");
  233. TextDrawLetterSize(Mega_Fone[1], 0.000000, 0.626500);
  234. TextDrawTextSize(Mega_Fone[1], 202.930282, 0.000000);
  235. TextDrawAlignment(Mega_Fone[1], 1);
  236. TextDrawColor(Mega_Fone[1], -1);
  237. TextDrawUseBox(Mega_Fone[1], 1);
  238. TextDrawBoxColor(Mega_Fone[1], 255);
  239. TextDrawSetShadow(Mega_Fone[1], 0);
  240. TextDrawSetOutline(Mega_Fone[1], 0);
  241. TextDrawBackgroundColor(Mega_Fone[1], 255);
  242. TextDrawFont(Mega_Fone[1], 1);
  243. TextDrawSetProportional(Mega_Fone[1], 1);
  244. TextDrawSetShadow(Mega_Fone[1], 0);
  245.  
  246. Mega_Fone[2] = TextDrawCreate(70.399978, 221.600006, "Megafone");
  247. TextDrawLetterSize(Mega_Fone[2], 0.326624, 1.110832);
  248. TextDrawAlignment(Mega_Fone[2], 1);
  249. TextDrawColor(Mega_Fone[2], -1);
  250. TextDrawSetShadow(Mega_Fone[2], 0);
  251. TextDrawSetOutline(Mega_Fone[2], 1);
  252. TextDrawBackgroundColor(Mega_Fone[2], 255);
  253. TextDrawFont(Mega_Fone[2], 1);
  254. TextDrawSetProportional(Mega_Fone[2], 1);
  255. TextDrawSetShadow(Mega_Fone[2], 0);
  256.  
  257. Mega_Fone[3] = TextDrawCreate(16.799995, 243.600006, "box");
  258. TextDrawLetterSize(Mega_Fone[3], 0.000000, 0.812500);
  259. TextDrawTextSize(Mega_Fone[3], 197.800018, 0.000000);
  260. TextDrawAlignment(Mega_Fone[3], 1);
  261. TextDrawColor(Mega_Fone[3], -1);
  262. TextDrawUseBox(Mega_Fone[3], 1);
  263. TextDrawBoxColor(Mega_Fone[3], -136);
  264. TextDrawSetShadow(Mega_Fone[3], 0);
  265. TextDrawSetOutline(Mega_Fone[3], 0);
  266. TextDrawBackgroundColor(Mega_Fone[3], 255);
  267. TextDrawFont(Mega_Fone[3], 1);
  268. TextDrawSetProportional(Mega_Fone[3], 1);
  269. TextDrawSetShadow(Mega_Fone[3], 0);
  270.  
  271. Mega_Fone[4] = TextDrawCreate(46.199996, 298.999633, "Y_-_N_para_CIMA/BAIXO.~n~CTRL_seleciona.");
  272. TextDrawLetterSize(Mega_Fone[4], 0.286874, 1.249999);
  273. TextDrawAlignment(Mega_Fone[4], 1);
  274. TextDrawColor(Mega_Fone[4], -5963521);
  275. TextDrawSetShadow(Mega_Fone[4], 0);
  276. TextDrawSetOutline(Mega_Fone[4], 1);
  277. TextDrawBackgroundColor(Mega_Fone[4], 255);
  278. TextDrawFont(Mega_Fone[4], 1);
  279. TextDrawSetProportional(Mega_Fone[4], 1);
  280. TextDrawSetShadow(Mega_Fone[4], 0);
  281.  
  282. #if defined J_OnGameModeInit
  283. return J_OnGameModeInit();
  284. #else
  285. return 1;
  286. #endif
  287. }
  288.  
  289. public OnGameModeExit()
  290. {
  291. TextDrawDestroy(Mega_Fone[0]);
  292. TextDrawDestroy(Mega_Fone[1]);
  293. TextDrawDestroy(Mega_Fone[2]);
  294. TextDrawDestroy(Mega_Fone[3]);
  295. TextDrawDestroy(Mega_Fone[4]);
  296.  
  297. #if defined J_OnGameModeExit
  298. return J_OnGameModeExit();
  299. #else
  300. return 1;
  301. #endif
  302. }
  303.  
  304. #endif
  305.  
  306. public OnPlayerConnect(playerid)
  307. {
  308. TextDrawsCriadas[playerid] = true;
  309. EstaUsandoMegafone[playerid] = false;
  310.  
  311. Mega_FoneString = CreatePlayerTextDraw(playerid, 19.400009, 240.799896, "Textdraw");
  312. PlayerTextDrawLetterSize(playerid, Mega_FoneString, 0.263124, 1.214999);
  313. PlayerTextDrawAlignment(playerid, Mega_FoneString, 1);
  314. PlayerTextDrawColor(playerid, Mega_FoneString, -1);
  315. PlayerTextDrawSetShadow(playerid, Mega_FoneString, 0);
  316. PlayerTextDrawSetOutline(playerid, Mega_FoneString, 0);
  317. PlayerTextDrawBackgroundColor(playerid, Mega_FoneString, 255);
  318. PlayerTextDrawFont(playerid, Mega_FoneString, 1);
  319. PlayerTextDrawSetProportional(playerid, Mega_FoneString, 1);
  320. PlayerTextDrawSetShadow(playerid, Mega_FoneString, 0);
  321.  
  322. #if defined J_OnPlayerConnect
  323. return J_OnPlayerConnect(playerid);
  324. #else
  325. return 1;
  326. #endif
  327. }
  328.  
  329. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  330. {
  331. new textdraw_string[143];
  332. if (newkeys & KEY_NO)
  333. {
  334. if(EstaUsandoMegafone[playerid])
  335. {
  336. if((SomAtual[playerid] != 50) & (SomAtual[playerid] != 80) & (SomAtual[playerid] != 89)) SomAtual[playerid]++;
  337.  
  338. if(SomAtual[playerid] == 49 || SomAtual[playerid] == 79 || SomAtual[playerid] == 88)
  339. {
  340. format(textdraw_string,sizeof(textdraw_string),"%s~n~~n~%s",Megafone[SomAtual[playerid]][1],Megafone[SomAtual[playerid]+1][1]);
  341. }
  342. else if(SomAtual[playerid] == 50 || SomAtual[playerid] == 80 || SomAtual[playerid] == 89)
  343. {
  344. format(textdraw_string,sizeof(textdraw_string),"%s",Megafone[SomAtual[playerid]][1]);
  345. }
  346. else
  347. {
  348. format(textdraw_string,sizeof(textdraw_string),"%s~n~~n~%s~n~~n~%s",Megafone[SomAtual[playerid]][1],Megafone[SomAtual[playerid]+1][1],Megafone[SomAtual[playerid]+2][1]);
  349. }
  350. PlayerTextDrawSetString(playerid,Mega_FoneString,textdraw_string);
  351. PlayerTextDrawShow(playerid,Mega_FoneString);
  352. }
  353. }
  354. if (newkeys & KEY_YES)
  355. {
  356. if(EstaUsandoMegafone[playerid])
  357. {
  358. if((SomAtual[playerid] != 0) & (SomAtual[playerid] != 51) & (SomAtual[playerid] != 81)) SomAtual[playerid]--;
  359.  
  360. if(SomAtual[playerid] == 49 || SomAtual[playerid] == 79 || SomAtual[playerid] == 88)
  361. {
  362. format(textdraw_string,sizeof(textdraw_string),"%s~n~~n~%s",Megafone[SomAtual[playerid]][1],Megafone[SomAtual[playerid]+1][1]);
  363. }
  364. else if(SomAtual[playerid] == 50 || SomAtual[playerid] == 80 || SomAtual[playerid] == 89)
  365. {
  366. format(textdraw_string,sizeof(textdraw_string),"%s",Megafone[SomAtual[playerid]][1]);
  367. }
  368. else
  369. {
  370. format(textdraw_string,sizeof(textdraw_string),"%s~n~~n~%s~n~~n~%s",Megafone[SomAtual[playerid]][1],Megafone[SomAtual[playerid]+1][1],Megafone[SomAtual[playerid]+2][1]);
  371. }
  372. PlayerTextDrawSetString(playerid,Mega_FoneString,textdraw_string);
  373. PlayerTextDrawShow(playerid,Mega_FoneString);
  374. }
  375. }
  376. if(newkeys & KEY_ACTION)
  377. {
  378. if(EstaUsandoMegafone[playerid])
  379. {
  380. new Float:mav_x,Float:mav_y,Float:mav_z;
  381. GetVehiclePos(GetPlayerVehicleID(playerid),mav_x,mav_y,mav_z);
  382. #if USAR_FOREACH true
  383. foreach(new p: Player)
  384. {
  385. if (IsPlayerInRangeOfPoint(p, 50.0, mav_x, mav_y, mav_z))
  386. {
  387. PlayerPlaySound(p, Megafone[SomAtual[playerid]][0], 0, 0, 0);
  388. }
  389. }
  390. #else
  391. for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
  392. {
  393. if(IsPlayerConnected(i))
  394. {
  395. if (IsPlayerInRangeOfPoint(i, 50.0, mav_x, mav_y, mav_z))
  396. {
  397. PlayerPlaySound(i, Megafone[SomAtual[playerid]][0], 0, 0, 0);
  398. }
  399. }
  400. }
  401. #endif
  402. }
  403. }
  404. #if defined J_OnPlayerKeyStateChange
  405. return J_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  406. #else
  407. return 1;
  408. #endif
  409. }
  410.  
  411. /*Funções*/
  412. stock AtivarMegafone(playerid,megafone_id)
  413. {
  414. if(1 < megafone_id > 3) return 0;
  415. EstaUsandoMegafone[playerid] = true;
  416. TextDrawShowForPlayer(playerid,Mega_Fone[0]);
  417. TextDrawShowForPlayer(playerid,Mega_Fone[1]);
  418. TextDrawShowForPlayer(playerid,Mega_Fone[2]);
  419. TextDrawShowForPlayer(playerid,Mega_Fone[3]);
  420. TextDrawShowForPlayer(playerid,Mega_Fone[4]);
  421.  
  422. if(!TextDrawsCriadas[playerid])
  423. {
  424. TextDrawsCriadas[playerid] = true;
  425. Mega_FoneString = CreatePlayerTextDraw(playerid, 19.400009, 240.799896, "Textdraw");
  426. PlayerTextDrawLetterSize(playerid, Mega_FoneString, 0.263124, 1.214999);
  427. PlayerTextDrawAlignment(playerid, Mega_FoneString, 1);
  428. PlayerTextDrawColor(playerid, Mega_FoneString, -1);
  429. PlayerTextDrawSetShadow(playerid, Mega_FoneString, 0);
  430. PlayerTextDrawSetOutline(playerid, Mega_FoneString, 0);
  431. PlayerTextDrawBackgroundColor(playerid, Mega_FoneString, 255);
  432. PlayerTextDrawFont(playerid, Mega_FoneString, 1);
  433. PlayerTextDrawSetProportional(playerid, Mega_FoneString, 1);
  434. PlayerTextDrawSetShadow(playerid, Mega_FoneString, 0);
  435. }
  436.  
  437. if(megafone_id == MEGAFONE_MAVERICK)
  438. {
  439. SomAtual[playerid] = 0;
  440. PlayerTextDrawSetString(playerid,Mega_FoneString,"This is Los Santos Police Department...~n~~n~We've got a visual on the suspect!~n~~n~We've got a clear shot on the suspect...");
  441. }
  442. else if(megafone_id == MEGAFONE_PREDATOR)
  443. {
  444. SomAtual[playerid] = 51;
  445. PlayerTextDrawSetString(playerid,Mega_FoneString,"This is the coast guard, stop your...~n~~n~Police! Stop! it will spoil your..~n~~n~Stop your vessel, tough guy!");
  446. }
  447. else if(megafone_id == MEGAFONE_CARRO)
  448. {
  449. SomAtual[playerid] = 81;
  450. PlayerTextDrawSetString(playerid,Mega_FoneString,"I see you! You are trying some way!~n~~n~You! Get out right now!~n~~n~We're gonna flip you, tough guy!");
  451. }
  452. PlayerTextDrawShow(playerid,Mega_FoneString);
  453. return 1;
  454. }
  455.  
  456. stock DesativarMegafone(playerid)
  457. {
  458. EstaUsandoMegafone[playerid] = false;
  459. TextDrawHideForPlayer(playerid,Mega_Fone[0]);
  460. TextDrawHideForPlayer(playerid,Mega_Fone[1]);
  461. TextDrawHideForPlayer(playerid,Mega_Fone[2]);
  462. TextDrawHideForPlayer(playerid,Mega_Fone[3]);
  463. TextDrawHideForPlayer(playerid,Mega_Fone[4]);
  464. PlayerTextDrawHide(playerid,Mega_FoneString);
  465. return 1;
  466. }
  467.  
  468. stock DesativarMegafoneParaTodos()
  469. {
  470. #if USAR_FOREACH true
  471. foreach(new i: Player)
  472. {
  473. EstaUsandoMegafone[i] = false;
  474. TextDrawHideForPlayer(i,Mega_Fone[0]);
  475. TextDrawHideForPlayer(i,Mega_Fone[1]);
  476. TextDrawHideForPlayer(i,Mega_Fone[2]);
  477. TextDrawHideForPlayer(i,Mega_Fone[3]);
  478. TextDrawHideForPlayer(i,Mega_Fone[4]);
  479. PlayerTextDrawHide(i,Mega_FoneString);
  480. }
  481. #else
  482. for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
  483. {
  484. if(IsPlayerConnected(i))
  485. {
  486. EstaUsandoMegafone[i] = false;
  487. TextDrawHideForPlayer(i,Mega_Fone[0]);
  488. TextDrawHideForPlayer(i,Mega_Fone[1]);
  489. TextDrawHideForPlayer(i,Mega_Fone[2]);
  490. TextDrawHideForPlayer(i,Mega_Fone[3]);
  491. TextDrawHideForPlayer(i,Mega_Fone[4]);
  492. PlayerTextDrawHide(i,Mega_FoneString);
  493. }
  494. }
  495. #endif
  496. return 1;
  497. }
  498.  
  499. stock UsandoMegafone(playerid)
  500. {
  501. if(EstaUsandoMegafone[playerid])
  502. {
  503. if(SomAtual[playerid] < 51) return 1;
  504. else if(SomAtual[playerid] > 50 && SomAtual[playerid] < 81) return 2;
  505. else if(SomAtual[playerid] > 80) return 3;
  506. }
  507. return 0;
  508. }
  509.  
  510. /*Hooks*/
  511. #if defined _ALS_OnPlayerConnect
  512. #undef OnPlayerConnect
  513. #else
  514. #define _ALS_OnPlayerConnect
  515. #endif
  516. #define OnPlayerConnect J_OnPlayerConnect
  517.  
  518. #if defined _ALS_OnPlayerKeyStateChange
  519. #undef OnPlayerKeyStateChange
  520. #else
  521. #define _ALS_OnPlayerKeyStateChange
  522. #endif
  523. #define OnPlayerKeyStateChange J_OnPlayerKeyStateChange
  524.  
  525. #if defined FILTERSCRIPT
  526.  
  527. #if defined _ALS_OnFilterScriptInit
  528. #undef OnFilterScriptInit
  529. #else
  530. #define _ALS_OnFilterScriptInit
  531. #endif
  532. #define OnFilterScriptInit J_OnFilterScriptInit
  533.  
  534. #if defined J_OnFilterScriptInit
  535. forward J_OnFilterScriptInit();
  536. #endif
  537.  
  538. #if defined _ALS_OnFilterScriptExit
  539. #undef OnFilterScriptExit
  540. #else
  541. #define _ALS_OnFilterScriptExit
  542. #endif
  543. #define OnFilterScriptExit J_OnFilterScriptExit
  544.  
  545. #if defined J_OnFilterScriptExit
  546. forward J_OnFilterScriptExit();
  547. #endif
  548.  
  549. #else
  550.  
  551. #if defined _ALS_OnGameModeInit
  552. #undef OnGameModeInit
  553. #else
  554. #define _ALS_OnGameModeInit
  555. #endif
  556. #define OnGameModeInit J_OnGameModeInit
  557.  
  558. #if defined J_OnGameModeInit
  559. forward J_OnGameModeInit();
  560. #endif
  561.  
  562. #if defined _ALS_OnGameModeExit
  563. #undef OnGameModeExit
  564. #else
  565. #define _ALS_OnGameModeExit
  566. #endif
  567. #define OnGameModeExit J_OnGameModeExit
  568.  
  569. #if defined J_OnGameModeExit
  570. forward J_OnGameModeExit();
  571. #endif
  572.  
  573. #endif
  574.  
  575. #if defined J_OnPlayerConnect
  576. forward J_OnPlayerConnect(playerid);
  577. #endif
  578.  
  579. #if defined J_OnPlayerKeyStateChange
  580. forward J_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  581. #endif
Advertisement
Add Comment
Please, Sign In to add comment