Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Megafone para veículos de polícia.
- por Jelly23.
- 12/03/2017 - 20:24
- */
- /*IDs*/
- #define MEGAFONE_MAVERICK (1)
- #define MEGAFONE_PREDATOR (2)
- #define MEGAFONE_CARRO (3)
- /*Uso de foreach*/
- #define USAR_FOREACH (true)
- /*TextDraws e arrays*/
- static
- Text:Mega_Fone[5] = Text:INVALID_TEXT_DRAW,
- PlayerText:Mega_FoneString = PlayerText:INVALID_TEXT_DRAW,
- bool:EstaUsandoMegafone[MAX_PLAYERS],
- bool:TextDrawsCriadas[MAX_PLAYERS],
- SomAtual[MAX_PLAYERS],
- /*Sons*/
- Megafone[][] = //id de som, string e id de megafone.
- {
- //Maverick
- {15800, "This is Los Santos Police Department...",MEGAFONE_MAVERICK},
- {56831, "We've got a visual on the suspect!",MEGAFONE_MAVERICK},
- {56832, "We've got a clear shot on the suspect...",MEGAFONE_MAVERICK},
- {56833, "Put your hands up, it's over!",MEGAFONE_MAVERICK},
- {56834, "Stop!",MEGAFONE_MAVERICK},
- {56835, "Hover it steady! Now shoot him on...",MEGAFONE_MAVERICK},
- {56836, "Give up! The game's up",MEGAFONE_MAVERICK},
- {56837, "This is aerial support, we've got...",MEGAFONE_MAVERICK},
- {56838, "I've got a headshot on you, tough...",MEGAFONE_MAVERICK},
- {56839, "We've got a clear visual on the...",MEGAFONE_MAVERICK},
- {56840, "Suspect is about to be terminated!",MEGAFONE_MAVERICK},
- {56841, "You are going down, hard man...",MEGAFONE_MAVERICK},
- {56842, "We've got a clear on the sighting...",MEGAFONE_MAVERICK},
- {56843, "I see her! She is beautiful...",MEGAFONE_MAVERICK},
- {56844, "Playtime is over kid! Oh, you're...",MEGAFONE_MAVERICK},
- {56845, "Jim, you've seen anything?...",MEGAFONE_MAVERICK},
- {56846, "Hey, I can see my house from here!...",MEGAFONE_MAVERICK},
- {56847, "SHOOT THAT ASSHOLE! I'm trying...",MEGAFONE_MAVERICK},
- {56848, "Why do i've to do all the shooting?...",MEGAFONE_MAVERICK},
- {56849, "We've got a clear sighting on our...",MEGAFONE_MAVERICK},
- {56850, "We can feel this guy blow a hole!",MEGAFONE_MAVERICK},
- {56851, "This is heli support. I'm about...",MEGAFONE_MAVERICK},
- {56852, "You! Stop! Or we will kill you!",MEGAFONE_MAVERICK},
- {56853, "You can't escape it, Asshole!",MEGAFONE_MAVERICK},
- {56854, "We're the police, moron, we...",MEGAFONE_MAVERICK},
- {56855, "You! Stop running! Now!",MEGAFONE_MAVERICK},
- {56856, "It's time to shut you up, asshole!",MEGAFONE_MAVERICK},
- {56857, "This is aerial support, suspect...",MEGAFONE_MAVERICK},
- {56858, "You're about to get taught...",MEGAFONE_MAVERICK},
- {56859, "Suspect is trying to escape!...",MEGAFONE_MAVERICK},
- {56860, "Suspect is escaping! Repeat: escaping!",MEGAFONE_MAVERICK},
- {56861, "This is helicopter support, we're...",MEGAFONE_MAVERICK},
- {56862, "This is chopper support, suspect in...",MEGAFONE_MAVERICK},
- {56863, "You're in trouble now, bad boy!",MEGAFONE_MAVERICK},
- {56864, "You're trying to screw up...",MEGAFONE_MAVERICK},
- {56865, "WE are the good guys, you little...",MEGAFONE_MAVERICK},
- {56866, "You still think you are hard, huh?",MEGAFONE_MAVERICK},
- {56867, "Suspect is about to be apprehended...",MEGAFONE_MAVERICK},
- {56868, "This is the aerial unit, we've got...",MEGAFONE_MAVERICK},
- {56869, "You're mine, tough guy!",MEGAFONE_MAVERICK},
- {56870, "Look at the birdie! It's dying...",MEGAFONE_MAVERICK},
- {56871, "This little party is about to get...",MEGAFONE_MAVERICK},
- {56872, "Oh, you can stop running now, sus...",MEGAFONE_MAVERICK},
- {56873, "Man, stop photographing those wom...",MEGAFONE_MAVERICK},
- {56874, "Where is he? Over there you dick...",MEGAFONE_MAVERICK},
- {56875, "Stop! Now! Right now! Just shoot him!",MEGAFONE_MAVERICK},
- {56876, "I'm going to kill this guy! Make...",MEGAFONE_MAVERICK},
- {56877, "You! Stop! Just shoot him, you pussy!",MEGAFONE_MAVERICK},
- {56878, "Hey! If i kill him, do I get a medal?",MEGAFONE_MAVERICK},
- {56879, "There is he, kill him! John, why...",MEGAFONE_MAVERICK},
- {56880, "This is aerial support... I think...",MEGAFONE_MAVERICK},
- //Predator
- {56800, "This is the coast guard, stop your...",MEGAFONE_PREDATOR},
- {56801, "Police! Stop! it will spoil your..",MEGAFONE_PREDATOR},
- {56802, "Stop your vessel, tough guy!",MEGAFONE_PREDATOR},
- {56803, "Vessel, this is San Andreas...",MEGAFONE_PREDATOR},
- {56804, "Vessel, What are your intentions?",MEGAFONE_PREDATOR},
- {56805, "You! Stop your fucking boat!",MEGAFONE_PREDATOR},
- {56806, "Stop that boat, now!",MEGAFONE_PREDATOR},
- {56807, "We'll intercept your vessel, stop.",MEGAFONE_PREDATOR},
- {56808, "Stop!",MEGAFONE_PREDATOR},
- {56809, "You! Stop your vessel now!",MEGAFONE_PREDATOR},
- {56810, "Just stop wise guy, before we...",MEGAFONE_PREDATOR},
- {56811, "You are getting to stop now!",MEGAFONE_PREDATOR},
- {56812, "Stop or we'll open fire in your...",MEGAFONE_PREDATOR},
- {56813, "This is the coast guard, stop...",MEGAFONE_PREDATOR},
- {56814, "Hey, You! This is the coast guard..",MEGAFONE_PREDATOR},
- {56815, "You! In that boat! Stop! Now!",MEGAFONE_PREDATOR},
- {56816, "This is the coast guard! We...",MEGAFONE_PREDATOR},
- {56817, "You are getting yourself in...",MEGAFONE_PREDATOR},
- {56818, "This is the San Andreas Coast...",MEGAFONE_PREDATOR},
- {56819, "You think we can't see you, dip..",MEGAFONE_PREDATOR},
- {56820, "Hey guy! I'm gonna make this quic..",MEGAFONE_PREDATOR},
- {56821, "Hey you! Stop right now!",MEGAFONE_PREDATOR},
- {56822, "This is the coast guard, asshole...",MEGAFONE_PREDATOR},
- {56823, "We want to make a...",MEGAFONE_PREDATOR},
- {56824, "Declare your attention, or we'll...",MEGAFONE_PREDATOR},
- {56825, "Tough guy! This is the coast guard..",MEGAFONE_PREDATOR},
- {56826, "Stop! This guy is really annoying...",MEGAFONE_PREDATOR},
- {56827, "Asshole, stop! Or you will get...",MEGAFONE_PREDATOR},
- {56828, "Hey, you! This is the coast guard...",MEGAFONE_PREDATOR},
- {56829, "There he is, there he is! You, stop!",MEGAFONE_PREDATOR},
- //Carro
- {56882, "I see you! You are trying some way!",MEGAFONE_CARRO},
- {56883, "You! Get out right now!",MEGAFONE_CARRO},
- {56884, "We're gonna flip you, tough guy!",MEGAFONE_CARRO},
- {56885, "You really wanna drive? Uh?",MEGAFONE_CARRO},
- {56886, "We got a suspect in the water...",MEGAFONE_CARRO},
- {56890, "You can't escape!",MEGAFONE_CARRO},
- {56904, "Give up! You dumb moron!",MEGAFONE_CARRO},
- {56906, "C'mon! Get outta there, asshole!",MEGAFONE_CARRO},
- {56907, "You ain't going nowhere, we got..",MEGAFONE_CARRO}
- };
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- /*TextDraws*/
- Mega_Fone[0] = TextDrawCreate(12.000000, 225.000000, "box");
- TextDrawLetterSize(Mega_Fone[0], 0.000000, 10.616493);
- TextDrawTextSize(Mega_Fone[0], 203.000000, 0.000000);
- TextDrawAlignment(Mega_Fone[0], 1);
- TextDrawColor(Mega_Fone[0], -1);
- TextDrawUseBox(Mega_Fone[0], 1);
- TextDrawBoxColor(Mega_Fone[0], 120);
- TextDrawSetShadow(Mega_Fone[0], 0);
- TextDrawSetOutline(Mega_Fone[0], 0);
- TextDrawBackgroundColor(Mega_Fone[0], 255);
- TextDrawFont(Mega_Fone[0], 1);
- TextDrawSetProportional(Mega_Fone[0], 1);
- TextDrawSetShadow(Mega_Fone[0], 0);
- Mega_Fone[1] = TextDrawCreate(12.000000, 225.000000, "box");
- TextDrawLetterSize(Mega_Fone[1], 0.000000, 0.626500);
- TextDrawTextSize(Mega_Fone[1], 202.930282, 0.000000);
- TextDrawAlignment(Mega_Fone[1], 1);
- TextDrawColor(Mega_Fone[1], -1);
- TextDrawUseBox(Mega_Fone[1], 1);
- TextDrawBoxColor(Mega_Fone[1], 255);
- TextDrawSetShadow(Mega_Fone[1], 0);
- TextDrawSetOutline(Mega_Fone[1], 0);
- TextDrawBackgroundColor(Mega_Fone[1], 255);
- TextDrawFont(Mega_Fone[1], 1);
- TextDrawSetProportional(Mega_Fone[1], 1);
- TextDrawSetShadow(Mega_Fone[1], 0);
- Mega_Fone[2] = TextDrawCreate(70.399978, 221.600006, "Megafone");
- TextDrawLetterSize(Mega_Fone[2], 0.326624, 1.110832);
- TextDrawAlignment(Mega_Fone[2], 1);
- TextDrawColor(Mega_Fone[2], -1);
- TextDrawSetShadow(Mega_Fone[2], 0);
- TextDrawSetOutline(Mega_Fone[2], 1);
- TextDrawBackgroundColor(Mega_Fone[2], 255);
- TextDrawFont(Mega_Fone[2], 1);
- TextDrawSetProportional(Mega_Fone[2], 1);
- TextDrawSetShadow(Mega_Fone[2], 0);
- Mega_Fone[3] = TextDrawCreate(16.799995, 243.600006, "box");
- TextDrawLetterSize(Mega_Fone[3], 0.000000, 0.812500);
- TextDrawTextSize(Mega_Fone[3], 197.800018, 0.000000);
- TextDrawAlignment(Mega_Fone[3], 1);
- TextDrawColor(Mega_Fone[3], -1);
- TextDrawUseBox(Mega_Fone[3], 1);
- TextDrawBoxColor(Mega_Fone[3], -136);
- TextDrawSetShadow(Mega_Fone[3], 0);
- TextDrawSetOutline(Mega_Fone[3], 0);
- TextDrawBackgroundColor(Mega_Fone[3], 255);
- TextDrawFont(Mega_Fone[3], 1);
- TextDrawSetProportional(Mega_Fone[3], 1);
- TextDrawSetShadow(Mega_Fone[3], 0);
- Mega_Fone[4] = TextDrawCreate(46.199996, 298.999633, "Y_-_N_para_CIMA/BAIXO.~n~CTRL_seleciona.");
- TextDrawLetterSize(Mega_Fone[4], 0.286874, 1.249999);
- TextDrawAlignment(Mega_Fone[4], 1);
- TextDrawColor(Mega_Fone[4], -5963521);
- TextDrawSetShadow(Mega_Fone[4], 0);
- TextDrawSetOutline(Mega_Fone[4], 1);
- TextDrawBackgroundColor(Mega_Fone[4], 255);
- TextDrawFont(Mega_Fone[4], 1);
- TextDrawSetProportional(Mega_Fone[4], 1);
- TextDrawSetShadow(Mega_Fone[4], 0);
- #if defined J_OnFilterScriptInit
- return J_OnFilterScriptInit();
- #else
- return 1;
- #endif
- }
- public OnFilterScriptExit()
- {
- TextDrawDestroy(Mega_Fone[0]);
- TextDrawDestroy(Mega_Fone[1]);
- TextDrawDestroy(Mega_Fone[2]);
- TextDrawDestroy(Mega_Fone[3]);
- TextDrawDestroy(Mega_Fone[4]);
- #if defined J_OnFilterScriptExit
- return J_OnFilterScriptExit();
- #else
- return 1;
- #endif
- }
- #else
- public OnGameModeInit()
- {
- /*TextDraws*/
- Mega_Fone[0] = TextDrawCreate(12.000000, 225.000000, "box");
- TextDrawLetterSize(Mega_Fone[0], 0.000000, 10.616493);
- TextDrawTextSize(Mega_Fone[0], 203.000000, 0.000000);
- TextDrawAlignment(Mega_Fone[0], 1);
- TextDrawColor(Mega_Fone[0], -1);
- TextDrawUseBox(Mega_Fone[0], 1);
- TextDrawBoxColor(Mega_Fone[0], 120);
- TextDrawSetShadow(Mega_Fone[0], 0);
- TextDrawSetOutline(Mega_Fone[0], 0);
- TextDrawBackgroundColor(Mega_Fone[0], 255);
- TextDrawFont(Mega_Fone[0], 1);
- TextDrawSetProportional(Mega_Fone[0], 1);
- TextDrawSetShadow(Mega_Fone[0], 0);
- Mega_Fone[1] = TextDrawCreate(12.000000, 225.000000, "box");
- TextDrawLetterSize(Mega_Fone[1], 0.000000, 0.626500);
- TextDrawTextSize(Mega_Fone[1], 202.930282, 0.000000);
- TextDrawAlignment(Mega_Fone[1], 1);
- TextDrawColor(Mega_Fone[1], -1);
- TextDrawUseBox(Mega_Fone[1], 1);
- TextDrawBoxColor(Mega_Fone[1], 255);
- TextDrawSetShadow(Mega_Fone[1], 0);
- TextDrawSetOutline(Mega_Fone[1], 0);
- TextDrawBackgroundColor(Mega_Fone[1], 255);
- TextDrawFont(Mega_Fone[1], 1);
- TextDrawSetProportional(Mega_Fone[1], 1);
- TextDrawSetShadow(Mega_Fone[1], 0);
- Mega_Fone[2] = TextDrawCreate(70.399978, 221.600006, "Megafone");
- TextDrawLetterSize(Mega_Fone[2], 0.326624, 1.110832);
- TextDrawAlignment(Mega_Fone[2], 1);
- TextDrawColor(Mega_Fone[2], -1);
- TextDrawSetShadow(Mega_Fone[2], 0);
- TextDrawSetOutline(Mega_Fone[2], 1);
- TextDrawBackgroundColor(Mega_Fone[2], 255);
- TextDrawFont(Mega_Fone[2], 1);
- TextDrawSetProportional(Mega_Fone[2], 1);
- TextDrawSetShadow(Mega_Fone[2], 0);
- Mega_Fone[3] = TextDrawCreate(16.799995, 243.600006, "box");
- TextDrawLetterSize(Mega_Fone[3], 0.000000, 0.812500);
- TextDrawTextSize(Mega_Fone[3], 197.800018, 0.000000);
- TextDrawAlignment(Mega_Fone[3], 1);
- TextDrawColor(Mega_Fone[3], -1);
- TextDrawUseBox(Mega_Fone[3], 1);
- TextDrawBoxColor(Mega_Fone[3], -136);
- TextDrawSetShadow(Mega_Fone[3], 0);
- TextDrawSetOutline(Mega_Fone[3], 0);
- TextDrawBackgroundColor(Mega_Fone[3], 255);
- TextDrawFont(Mega_Fone[3], 1);
- TextDrawSetProportional(Mega_Fone[3], 1);
- TextDrawSetShadow(Mega_Fone[3], 0);
- Mega_Fone[4] = TextDrawCreate(46.199996, 298.999633, "Y_-_N_para_CIMA/BAIXO.~n~CTRL_seleciona.");
- TextDrawLetterSize(Mega_Fone[4], 0.286874, 1.249999);
- TextDrawAlignment(Mega_Fone[4], 1);
- TextDrawColor(Mega_Fone[4], -5963521);
- TextDrawSetShadow(Mega_Fone[4], 0);
- TextDrawSetOutline(Mega_Fone[4], 1);
- TextDrawBackgroundColor(Mega_Fone[4], 255);
- TextDrawFont(Mega_Fone[4], 1);
- TextDrawSetProportional(Mega_Fone[4], 1);
- TextDrawSetShadow(Mega_Fone[4], 0);
- #if defined J_OnGameModeInit
- return J_OnGameModeInit();
- #else
- return 1;
- #endif
- }
- public OnGameModeExit()
- {
- TextDrawDestroy(Mega_Fone[0]);
- TextDrawDestroy(Mega_Fone[1]);
- TextDrawDestroy(Mega_Fone[2]);
- TextDrawDestroy(Mega_Fone[3]);
- TextDrawDestroy(Mega_Fone[4]);
- #if defined J_OnGameModeExit
- return J_OnGameModeExit();
- #else
- return 1;
- #endif
- }
- #endif
- public OnPlayerConnect(playerid)
- {
- TextDrawsCriadas[playerid] = true;
- EstaUsandoMegafone[playerid] = false;
- Mega_FoneString = CreatePlayerTextDraw(playerid, 19.400009, 240.799896, "Textdraw");
- PlayerTextDrawLetterSize(playerid, Mega_FoneString, 0.263124, 1.214999);
- PlayerTextDrawAlignment(playerid, Mega_FoneString, 1);
- PlayerTextDrawColor(playerid, Mega_FoneString, -1);
- PlayerTextDrawSetShadow(playerid, Mega_FoneString, 0);
- PlayerTextDrawSetOutline(playerid, Mega_FoneString, 0);
- PlayerTextDrawBackgroundColor(playerid, Mega_FoneString, 255);
- PlayerTextDrawFont(playerid, Mega_FoneString, 1);
- PlayerTextDrawSetProportional(playerid, Mega_FoneString, 1);
- PlayerTextDrawSetShadow(playerid, Mega_FoneString, 0);
- #if defined J_OnPlayerConnect
- return J_OnPlayerConnect(playerid);
- #else
- return 1;
- #endif
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- new textdraw_string[143];
- if (newkeys & KEY_NO)
- {
- if(EstaUsandoMegafone[playerid])
- {
- if((SomAtual[playerid] != 50) & (SomAtual[playerid] != 80) & (SomAtual[playerid] != 89)) SomAtual[playerid]++;
- if(SomAtual[playerid] == 49 || SomAtual[playerid] == 79 || SomAtual[playerid] == 88)
- {
- format(textdraw_string,sizeof(textdraw_string),"%s~n~~n~%s",Megafone[SomAtual[playerid]][1],Megafone[SomAtual[playerid]+1][1]);
- }
- else if(SomAtual[playerid] == 50 || SomAtual[playerid] == 80 || SomAtual[playerid] == 89)
- {
- format(textdraw_string,sizeof(textdraw_string),"%s",Megafone[SomAtual[playerid]][1]);
- }
- else
- {
- 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]);
- }
- PlayerTextDrawSetString(playerid,Mega_FoneString,textdraw_string);
- PlayerTextDrawShow(playerid,Mega_FoneString);
- }
- }
- if (newkeys & KEY_YES)
- {
- if(EstaUsandoMegafone[playerid])
- {
- if((SomAtual[playerid] != 0) & (SomAtual[playerid] != 51) & (SomAtual[playerid] != 81)) SomAtual[playerid]--;
- if(SomAtual[playerid] == 49 || SomAtual[playerid] == 79 || SomAtual[playerid] == 88)
- {
- format(textdraw_string,sizeof(textdraw_string),"%s~n~~n~%s",Megafone[SomAtual[playerid]][1],Megafone[SomAtual[playerid]+1][1]);
- }
- else if(SomAtual[playerid] == 50 || SomAtual[playerid] == 80 || SomAtual[playerid] == 89)
- {
- format(textdraw_string,sizeof(textdraw_string),"%s",Megafone[SomAtual[playerid]][1]);
- }
- else
- {
- 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]);
- }
- PlayerTextDrawSetString(playerid,Mega_FoneString,textdraw_string);
- PlayerTextDrawShow(playerid,Mega_FoneString);
- }
- }
- if(newkeys & KEY_ACTION)
- {
- if(EstaUsandoMegafone[playerid])
- {
- new Float:mav_x,Float:mav_y,Float:mav_z;
- GetVehiclePos(GetPlayerVehicleID(playerid),mav_x,mav_y,mav_z);
- #if USAR_FOREACH true
- foreach(new p: Player)
- {
- if (IsPlayerInRangeOfPoint(p, 50.0, mav_x, mav_y, mav_z))
- {
- PlayerPlaySound(p, Megafone[SomAtual[playerid]][0], 0, 0, 0);
- }
- }
- #else
- for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
- {
- if(IsPlayerConnected(i))
- {
- if (IsPlayerInRangeOfPoint(i, 50.0, mav_x, mav_y, mav_z))
- {
- PlayerPlaySound(i, Megafone[SomAtual[playerid]][0], 0, 0, 0);
- }
- }
- }
- #endif
- }
- }
- #if defined J_OnPlayerKeyStateChange
- return J_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
- #else
- return 1;
- #endif
- }
- /*Funções*/
- stock AtivarMegafone(playerid,megafone_id)
- {
- if(1 < megafone_id > 3) return 0;
- EstaUsandoMegafone[playerid] = true;
- TextDrawShowForPlayer(playerid,Mega_Fone[0]);
- TextDrawShowForPlayer(playerid,Mega_Fone[1]);
- TextDrawShowForPlayer(playerid,Mega_Fone[2]);
- TextDrawShowForPlayer(playerid,Mega_Fone[3]);
- TextDrawShowForPlayer(playerid,Mega_Fone[4]);
- if(!TextDrawsCriadas[playerid])
- {
- TextDrawsCriadas[playerid] = true;
- Mega_FoneString = CreatePlayerTextDraw(playerid, 19.400009, 240.799896, "Textdraw");
- PlayerTextDrawLetterSize(playerid, Mega_FoneString, 0.263124, 1.214999);
- PlayerTextDrawAlignment(playerid, Mega_FoneString, 1);
- PlayerTextDrawColor(playerid, Mega_FoneString, -1);
- PlayerTextDrawSetShadow(playerid, Mega_FoneString, 0);
- PlayerTextDrawSetOutline(playerid, Mega_FoneString, 0);
- PlayerTextDrawBackgroundColor(playerid, Mega_FoneString, 255);
- PlayerTextDrawFont(playerid, Mega_FoneString, 1);
- PlayerTextDrawSetProportional(playerid, Mega_FoneString, 1);
- PlayerTextDrawSetShadow(playerid, Mega_FoneString, 0);
- }
- if(megafone_id == MEGAFONE_MAVERICK)
- {
- SomAtual[playerid] = 0;
- 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...");
- }
- else if(megafone_id == MEGAFONE_PREDATOR)
- {
- SomAtual[playerid] = 51;
- 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!");
- }
- else if(megafone_id == MEGAFONE_CARRO)
- {
- SomAtual[playerid] = 81;
- 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!");
- }
- PlayerTextDrawShow(playerid,Mega_FoneString);
- return 1;
- }
- stock DesativarMegafone(playerid)
- {
- EstaUsandoMegafone[playerid] = false;
- TextDrawHideForPlayer(playerid,Mega_Fone[0]);
- TextDrawHideForPlayer(playerid,Mega_Fone[1]);
- TextDrawHideForPlayer(playerid,Mega_Fone[2]);
- TextDrawHideForPlayer(playerid,Mega_Fone[3]);
- TextDrawHideForPlayer(playerid,Mega_Fone[4]);
- PlayerTextDrawHide(playerid,Mega_FoneString);
- return 1;
- }
- stock DesativarMegafoneParaTodos()
- {
- #if USAR_FOREACH true
- foreach(new i: Player)
- {
- EstaUsandoMegafone[i] = false;
- TextDrawHideForPlayer(i,Mega_Fone[0]);
- TextDrawHideForPlayer(i,Mega_Fone[1]);
- TextDrawHideForPlayer(i,Mega_Fone[2]);
- TextDrawHideForPlayer(i,Mega_Fone[3]);
- TextDrawHideForPlayer(i,Mega_Fone[4]);
- PlayerTextDrawHide(i,Mega_FoneString);
- }
- #else
- for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
- {
- if(IsPlayerConnected(i))
- {
- EstaUsandoMegafone[i] = false;
- TextDrawHideForPlayer(i,Mega_Fone[0]);
- TextDrawHideForPlayer(i,Mega_Fone[1]);
- TextDrawHideForPlayer(i,Mega_Fone[2]);
- TextDrawHideForPlayer(i,Mega_Fone[3]);
- TextDrawHideForPlayer(i,Mega_Fone[4]);
- PlayerTextDrawHide(i,Mega_FoneString);
- }
- }
- #endif
- return 1;
- }
- stock UsandoMegafone(playerid)
- {
- if(EstaUsandoMegafone[playerid])
- {
- if(SomAtual[playerid] < 51) return 1;
- else if(SomAtual[playerid] > 50 && SomAtual[playerid] < 81) return 2;
- else if(SomAtual[playerid] > 80) return 3;
- }
- return 0;
- }
- /*Hooks*/
- #if defined _ALS_OnPlayerConnect
- #undef OnPlayerConnect
- #else
- #define _ALS_OnPlayerConnect
- #endif
- #define OnPlayerConnect J_OnPlayerConnect
- #if defined _ALS_OnPlayerKeyStateChange
- #undef OnPlayerKeyStateChange
- #else
- #define _ALS_OnPlayerKeyStateChange
- #endif
- #define OnPlayerKeyStateChange J_OnPlayerKeyStateChange
- #if defined FILTERSCRIPT
- #if defined _ALS_OnFilterScriptInit
- #undef OnFilterScriptInit
- #else
- #define _ALS_OnFilterScriptInit
- #endif
- #define OnFilterScriptInit J_OnFilterScriptInit
- #if defined J_OnFilterScriptInit
- forward J_OnFilterScriptInit();
- #endif
- #if defined _ALS_OnFilterScriptExit
- #undef OnFilterScriptExit
- #else
- #define _ALS_OnFilterScriptExit
- #endif
- #define OnFilterScriptExit J_OnFilterScriptExit
- #if defined J_OnFilterScriptExit
- forward J_OnFilterScriptExit();
- #endif
- #else
- #if defined _ALS_OnGameModeInit
- #undef OnGameModeInit
- #else
- #define _ALS_OnGameModeInit
- #endif
- #define OnGameModeInit J_OnGameModeInit
- #if defined J_OnGameModeInit
- forward J_OnGameModeInit();
- #endif
- #if defined _ALS_OnGameModeExit
- #undef OnGameModeExit
- #else
- #define _ALS_OnGameModeExit
- #endif
- #define OnGameModeExit J_OnGameModeExit
- #if defined J_OnGameModeExit
- forward J_OnGameModeExit();
- #endif
- #endif
- #if defined J_OnPlayerConnect
- forward J_OnPlayerConnect(playerid);
- #endif
- #if defined J_OnPlayerKeyStateChange
- forward J_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
- #endif
Advertisement
Add Comment
Please, Sign In to add comment