Gguiz007

Untitled

May 10th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.67 KB | None | 0 0
  1. new Vehicles[][] =
  2. {
  3. "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
  4. "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
  5. "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
  6. "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
  7. "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
  8. "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
  9. "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
  10. "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder",
  11. "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's Van",
  12. "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
  13. "Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy",
  14. "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX",
  15. "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper",
  16. "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking",
  17. "Blista Compact", "Police Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin",
  18. "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT",
  19. "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt",
  20. "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
  21. "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
  22. "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer",
  23. "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent",
  24. "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo",
  25. "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
  26. "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
  27. "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
  28. "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
  29. "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
  30. "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
  31. "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",
  32. "Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
  33. "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
  34. "Tiller", "Utility Trailer"
  35. };
  36.  
  37.  
  38. forward Speedometer_Update(playerid);
  39. forward RefuelVehicle(playerid);
  40.  
  41.  
  42. // This function sets up the speedometer for the given player
  43. Speedometer_Setup(playerid)
  44. {
  45. APlayerData[playerid][SpeedometerTimer] = SetTimerEx("Speedometer_Update", 200, true, "i", playerid);
  46.  
  47. return 1;
  48. }
  49.  
  50. // This function cleans up the speedometer for the given player
  51. Speedometer_Cleanup(playerid)
  52. {
  53. // Destroy the speedometer textdraw
  54. //PlayerTextDrawHide(playerid, SpeedometerText[playerid]);
  55. PlayerTextDrawHide(playerid, FuelGauge[playerid]);
  56. PlayerTextDrawHide(playerid, Textdraw0z[playerid]);
  57. PlayerTextDrawHide(playerid, Textdraw1z[playerid]);
  58. PlayerTextDrawHide(playerid, Textdraw2z[playerid]);
  59. PlayerTextDrawHide(playerid, Textdraw5z[playerid]);
  60. PlayerTextDrawHide(playerid, Textdraw7z[playerid]);
  61. PlayerTextDrawHide(playerid, Textdraw8z[playerid]);
  62. PlayerTextDrawHide(playerid, Textdraw9z[playerid]);
  63. PlayerTextDrawHide(playerid, Textdraw10z[playerid]);
  64. PlayerTextDrawHide(playerid, Textdraw11z[playerid]);
  65. PlayerTextDrawHide(playerid, Textdraw12z[playerid]);
  66. PlayerTextDrawHide(playerid, Textdraw13z[playerid]);
  67. PlayerTextDrawHide(playerid, Textdraw14z[playerid]);
  68. PlayerTextDrawHide(playerid, Textdraw15z[playerid]);
  69. PlayerTextDrawHide(playerid, Textdraw16z[playerid]);
  70. PlayerTextDrawHide(playerid, Textdraw17z[playerid]);
  71. //PlayerTextDrawHide(playerid, Textdraw18z[playerid]);
  72. PlayerTextDrawHide(playerid, Oqvcquiser[playerid]);
  73. PlayerTextDrawHide(playerid, Lataria[playerid]);
  74.  
  75. // Kill the speedometer timer
  76. KillTimer(APlayerData[playerid][SpeedometerTimer]);
  77. // Set player speed to 0
  78. APlayerData[playerid][PlayerSpeed] = 0;
  79.  
  80. return 1;
  81. }
  82.  
  83. public Speedometer_Update(playerid)
  84. {
  85. new vehicleid, Float:speed_x, Float:speed_y, Float:speed_z, Float:final_speed, speed_string[50], final_speed_int;
  86. new FuelString[50], Name[24];
  87.  
  88. vehicleid = GetPlayerVehicleID(playerid);
  89.  
  90. AntiHack(playerid);
  91.  
  92. if (GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
  93. {
  94. new OtherPlayer = APlayerData[playerid][SpectateID];
  95. GetPlayerName(OtherPlayer, Name, sizeof(Name));
  96.  
  97. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(OtherPlayer));
  98. SetPlayerInterior(playerid, GetPlayerInterior(OtherPlayer));
  99.  
  100. if (APlayerData[playerid][SpectateType] == ADMIN_SPEC_TYPE_PLAYER)
  101. {
  102.  
  103. // Check if the target player has entered a vehicle
  104. if (GetPlayerVehicleSeat(OtherPlayer) != -1)
  105. {
  106.  
  107. // Change spectate mode to vehicle
  108. PlayerSpectateVehicle(playerid, GetPlayerVehicleID(OtherPlayer));
  109. APlayerData[playerid][SpectateID] = OtherPlayer;
  110. APlayerData[playerid][SpectateVehicle] = GetPlayerVehicleID(OtherPlayer);
  111. APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_VEHICLE;
  112. }
  113. }
  114. else
  115. {
  116. if (GetPlayerVehicleSeat(OtherPlayer) == -1)
  117. {
  118. PlayerSpectatePlayer(playerid, OtherPlayer);
  119. SetPlayerInterior(playerid, GetPlayerInterior(OtherPlayer));
  120. APlayerData[playerid][SpectateID] = OtherPlayer;
  121. APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_PLAYER;
  122. }
  123. }
  124. }
  125.  
  126. if (APlayerData[playerid][PoliceWarnedMe] == true)
  127. {
  128. if (GetPlayerWantedLevel(playerid) == 0)
  129. {
  130.  
  131. APlayerData[playerid][ExercitoCanJailMe] = false;
  132. APlayerData[playerid][PoliceWarnedMe] = false;
  133. APlayerData[playerid][Value_ExercitoCanJailMe] = 0;
  134. KillTimer(APlayerData[playerid][Timer_ExercitoCanJailMe]);
  135. }
  136. }
  137.  
  138. // If the player is inside a vehicle
  139. if(vehicleid != 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  140. {
  141.  
  142. GetVehicleVelocity(vehicleid, speed_x, speed_y, speed_z);
  143. final_speed = floatsqroot(((speed_x * speed_x) + (speed_y * speed_y)) + (speed_z * speed_z)) * 158.179;
  144. final_speed_int = floatround(final_speed, floatround_round);
  145. APlayerData[playerid][PlayerSpeed] = final_speed_int;
  146. format(speed_string, 50, "%i KM/H", final_speed_int);
  147. PlayerTextDrawSetString(playerid, SpeedometerText[playerid], speed_string);
  148.  
  149. APlayerData[playerid][StatsMetersDriven] = APlayerData[playerid][StatsMetersDriven] + (final_speed / 7.2);
  150.  
  151. //Vehicle Name
  152. new VehNamed[32];
  153.  
  154. format(VehNamed, 32, "%s", GetVehName(vehicleid));
  155. PlayerTextDrawSetString(playerid, Textdraw15z[playerid], VehNamed);
  156.  
  157. if (AVehicleData[vehicleid][Fuel] != 0){
  158. if ((APlayerData[playerid][PlayerSpeed] > 10) && (AVehicleData[vehicleid][Fuel] > 0) && GetPVarInt(playerid, "consumir_combustivel") < GetTickCount()) {
  159. AVehicleData[vehicleid][Fuel] = AVehicleData[vehicleid][Fuel] - 1; // Decrease the fuel for this vehicle every time the timer is run
  160. SetPVarInt(playerid, "consumir_combustivel", GetTickCount() + 500);
  161. }
  162. format(FuelString, 64, "%0.0f%", floatdiv(AVehicleData[vehicleid][Fuel], (MaxFuel / 100)));
  163. PlayerTextDrawSetString(playerid, FuelGauge[playerid], FuelString);
  164. }
  165. else
  166. PlayerTextDrawSetString(playerid, FuelGauge[playerid], "");
  167.  
  168. /*
  169. if ((final_speed_int > 10) && (AVehicleData[vehicleid][Fuel] > 0))
  170. AVehicleData[vehicleid][Fuel] = AVehicleData[vehicleid][Fuel] - 1; // Decrease the fuel for this vehicle every time the timer is run
  171.  
  172. // Construct the fuelgauge
  173. if ((AVehicleData[vehicleid][Fuel] > 0) && (AVehicleData[vehicleid][Fuel] < 100000))
  174. format(FuelStatus, 64, "~r~%s~y~%s", "100%~n~99%~n~98%~n~97%", "~n~96%"); // Fuel is between 0% and 10% full
  175.  
  176. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 1)) && (AVehicleData[vehicleid][Fuel] < ((MaxFuel / 10) * 2)))
  177. format(FuelStatus, 64, "~r~%s~g~~h~%s", "l~n~l~n~l~n~l", "~n~l"); // 1 pt
  178.  
  179. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 2)) && (AVehicleData[vehicleid][Fuel] < ((MaxFuel / 10) * 3)))
  180. format(FuelStatus, 64, "~r~%s~y~%s~g~~h~%s", "l~n~l~n~l", "~n~l", "~n~l");// 2 pts [-]
  181.  
  182. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 3)) && (AVehicleData[vehicleid][Fuel] < ((MaxFuel / 10) * 4)))
  183. format(FuelStatus, 64, "~r~%s~g~~h~%s","l~n~l~n~l", "~n~l~n~l");// 2 pts
  184.  
  185. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 4)) && (AVehicleData[vehicleid][Fuel] < ((MaxFuel / 10) * 5)))
  186. format(FuelStatus, 64, "~r~%s~y~%s~g~~h~%s", "l~n~l", "~n~l", "~n~l~n~l");// 3 pts [-]
  187.  
  188. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 5)) && (AVehicleData[vehicleid][Fuel] < ((MaxFuel / 10) * 6)))
  189. format(FuelStatus, 64, "~r~%s~g~~h~%s", "l~n~l", "~n~l~n~l~n~l");// 3 pts
  190.  
  191. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 6)) && (AVehicleData[vehicleid][Fuel] < ((MaxFuel / 10) * 7)))
  192. format(FuelStatus, 64, "~r~%s~y~%s~g~~h~%s", "l", "~n~l", "~n~l~n~l~n~l");//4 pts [-]
  193.  
  194. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 7)) && (AVehicleData[vehicleid][Fuel] < ((MaxFuel / 10) * 8)))
  195. format(FuelStatus, 64, "~r~%s~g~~h~%s", "l", "~n~l~n~l~n~l~n~l");//4 pts
  196.  
  197. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 8)) && (AVehicleData[vehicleid][Fuel] < ((MaxFuel / 10) * 9)))
  198. format(FuelStatus, 64, "~y~%s~g~~h~%s", "99%", "n~98%~n~97%~n~96%");//full [-]
  199.  
  200. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 9)) && (AVehicleData[vehicleid][Fuel] <= MaxFuel))
  201. format(FuelStatus, 64, "%s", "100%"); //full
  202.  
  203.  
  204. if (AVehicleData[vehicleid][Fuel] == 0)
  205. format(FuelStatus, 64, "%s", "100%");
  206.  
  207. format(FuelString, 64, "%s", FuelStatus);
  208. PlayerTextDrawSetString(playerid, FuelGauge[playerid], FuelString);*/
  209.  
  210.  
  211.  
  212. new engine, lights, alarm, doors, bonnet, boot, objective;
  213.  
  214. if (AVehicleData[vehicleid][Fuel] == 0)
  215. {
  216.  
  217. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  218. SetVehicleParamsEx(vehicleid, 0, 0, alarm, doors, bonnet, boot, objective);
  219.  
  220. }
  221.  
  222. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  223. if(engine == 1)
  224. {
  225. PlayerTextDrawColor(playerid, Textdraw12z[playerid], 16711935);
  226. }
  227. else
  228. {
  229. PlayerTextDrawColor(playerid, Textdraw12z[playerid], -16776961);
  230. }
  231. if(lights == 1)
  232. {
  233. PlayerTextDrawColor(playerid, Textdraw14z[playerid], 16711935);
  234. }
  235. else
  236. {
  237. PlayerTextDrawColor(playerid, Textdraw14z[playerid], -16776961);
  238. }
  239. if(bonnet == 1)
  240. {
  241. PlayerTextDrawColor(playerid, Textdraw11z[playerid], 16711935);
  242. }
  243. else
  244. {
  245. PlayerTextDrawColor(playerid, Textdraw11z[playerid], -16776961);
  246. }
  247. if(alarm == 1)
  248. {
  249. PlayerTextDrawColor(playerid, Textdraw13z[playerid], 16711935);
  250. }
  251. else
  252. {
  253. PlayerTextDrawColor(playerid, Textdraw13z[playerid], -16776961);
  254. }
  255. // Enable the TextDraw for this player
  256. PlayerTextDrawShow(playerid, FuelGauge[playerid]);
  257. PlayerTextDrawShow(playerid, SpeedometerText[playerid]);
  258. PlayerTextDrawShow(playerid, Textdraw0z[playerid]);
  259. PlayerTextDrawShow(playerid, Textdraw1z[playerid]);
  260. PlayerTextDrawShow(playerid, Textdraw2z[playerid]);
  261. PlayerTextDrawShow(playerid, Textdraw7z[playerid]);
  262. PlayerTextDrawShow(playerid, Textdraw8z[playerid]);
  263. PlayerTextDrawShow(playerid, Textdraw9z[playerid]);
  264. PlayerTextDrawShow(playerid, Textdraw10z[playerid]);
  265. PlayerTextDrawShow(playerid, Textdraw11z[playerid]);
  266. PlayerTextDrawShow(playerid, Textdraw12z[playerid]);
  267. PlayerTextDrawShow(playerid, Textdraw13z[playerid]);
  268. PlayerTextDrawShow(playerid, Textdraw14z[playerid]);
  269. PlayerTextDrawShow(playerid, Textdraw15z[playerid]);
  270. PlayerTextDrawShow(playerid, Textdraw16z[playerid]);
  271. PlayerTextDrawShow(playerid, Textdraw17z[playerid]);
  272. //PlayerTextDrawShow(playerid, Textdraw18z[playerid]);
  273.  
  274. if (IsVehicleAirVehicle(vehicleid) == 0 && BarcoVeiculos(vehicleid) == 0)
  275. if (APlayerData[playerid][PlayerClass] != ClassPolice && APlayerData[playerid][PlayerClass] != ClassExercito)
  276. CheckPlayerSpeeding(playerid);
  277. }
  278. else
  279. {
  280. APlayerData[playerid][PlayerSpeed] = 0;
  281.  
  282. PlayerTextDrawHide(playerid,Textdraw0z[playerid]);
  283. PlayerTextDrawHide(playerid,Textdraw1z[playerid]);
  284. PlayerTextDrawHide(playerid,Textdraw2z[playerid]);
  285. //PlayerTextDrawHide(playerid,Textdraw5z[playerid]);
  286. PlayerTextDrawHide(playerid,Textdraw7z[playerid]);
  287. PlayerTextDrawHide(playerid,Textdraw8z[playerid]);
  288. PlayerTextDrawHide(playerid,Textdraw9z[playerid]);
  289. PlayerTextDrawHide(playerid,Textdraw10z[playerid]);
  290. PlayerTextDrawHide(playerid,Textdraw11z[playerid]);
  291. PlayerTextDrawHide(playerid,Textdraw12z[playerid]);
  292. PlayerTextDrawHide(playerid,Textdraw13z[playerid]);
  293. PlayerTextDrawHide(playerid,Textdraw14z[playerid]);
  294. PlayerTextDrawHide(playerid,Textdraw15z[playerid]);
  295. PlayerTextDrawHide(playerid,Textdraw16z[playerid]);
  296. PlayerTextDrawHide(playerid,Textdraw17z[playerid]);
  297. //PlayerTextDrawHide(playerid,Textdraw18z[playerid]);
  298. }
  299. }
  300.  
  301.  
  302.  
  303. // This timer-function is called when a player picks up a refuelpickup
  304. public RefuelVehicle(playerid)
  305. {
  306. new RefuelMsg[128];
  307. // Get the vehicle-id of the player's vehicle
  308. new vID = GetPlayerVehicleID(playerid);
  309. // Calculate the amount of fuel that needs to be refuelled
  310. new Amount = MaxFuel - AVehicleData[vID][Fuel];
  311. // Calculate the price to refuel
  312. new RefuelPrice = (Amount * RefuelMaxPrice) / MaxFuel;
  313.  
  314. // Check if the player has enough cash
  315. if (APlayerData[playerid][PlayerMoney] >= RefuelPrice)
  316. {
  317.  
  318. // Refuel the vehicle
  319. AVehicleData[vID][Fuel] = MaxFuel;
  320. // Withdraw the money from the player
  321. Ganhos(playerid, -RefuelPrice, 0);
  322. // Let the player know he refuelled his vehicle
  323. format(RefuelMsg, 128, "{FFA500}Você reabasteceu seu veículo por {00FF00}R${FFFFFF}%i", RefuelPrice);
  324. SCM(playerid, 0xFFFFFFFF, RefuelMsg);
  325. }
  326. else
  327. SCM(playerid, 0xFFFFFFFF, "{FFA500}Você não tem dinheiro suficiente para abastecer seu veículo.");
  328.  
  329. // Allow the player to move again
  330. TogglePlayerControllable(playerid, 1);
  331.  
  332. return 1;
  333. }
  334.  
  335.  
  336.  
  337. // This function checks if the player is speeding near a speedcamera
  338. CheckPlayerSpeeding(playerid)
  339. {
  340. // Setup local variables
  341. new Name[24], str[128], Msg[128];
  342.  
  343. // Check if the player hasn't been caught speeding recently
  344. if (APlayerData[playerid][PlayerCaughtSpeeding] == 0)
  345. {
  346.  
  347. // Loop through all speedcameras
  348. for (new CamID; CamID < MAX_CAMERAS; CamID++)
  349. {
  350.  
  351. // Check if this camera has been created
  352. if (ACameras[CamID][CamSpeed] != 0)
  353. {
  354.  
  355. // Check if the player is the driver of the vehicle
  356. if (GetPlayerVehicleSeat(playerid) == 0)
  357. {
  358.  
  359. // Check if the player's speed is greater than the speed allowed by this camera (no need to process a distance-check if not speeding)
  360. if (APlayerData[playerid][PlayerSpeed] > ACameras[CamID][CamSpeed] + ACameras[CamID][CamSpeed] * 5 / 100)
  361. {
  362. // Check if the player is near the camera
  363. if (IsPlayerInRangeOfPoint(playerid, 40.0, ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ]))
  364. {
  365. if(Paused[playerid] == false) {
  366. if( GetPVarInt( playerid, "TempoComandoAFK" ) > GetTickCount() ) return 0;
  367. SetPVarInt( playerid, "TempoComandoAFK", GetTickCount() + 5000 );
  368. // Prevent the player being caught multiple times by the same speed-camera
  369. APlayerData[playerid][PlayerCaughtSpeeding] = 20;
  370. // Increase the wanted-level of this player by 1 star
  371. SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
  372. // Let the player know he's been caught speeding
  373. format( str, sizeof str,"{FF0000}Você passou à {FFFFFF}%dKm/h {FF0000}(Permitido: {FFFFFF}%dKm/h +5°/.{FF0000}).", APlayerData[playerid][PlayerSpeed], ACameras[CamID][CamSpeed]);
  374. SCM( playerid, -1, str );
  375.  
  376. // Get the name of the player
  377. GetPlayerName(playerid, Name, sizeof(Name));
  378. // Also inform all police players that this player is caught speeding
  379. format(Msg, 250, "{FF0000}Player {FFFFFF}%s{FF0000} foi pêgo em alta-velocidade. Persiga-o e Multe.", Name);
  380. Police_SendMessage(Msg);
  381. format(Msg, 128, "{FF0000}Visto pela última vez nas redondezas de: {FFFFFF}%s", ReturnPlayerZone(playerid));
  382. Police_SendMessage(Msg);
  383. }
  384. }
  385. }
  386. }
  387. }
  388. }
  389. }
  390. else // If the player has been caught before, reduce the value until it's 0 again, then he can be caught again
  391. APlayerData[playerid][PlayerCaughtSpeeding]--;
  392. return 1;
  393. }
  394.  
  395.  
  396.  
  397. // This function processes anti-hack stuff
  398. stock AntiHack(playerid)
  399. {
  400. // Setup local variables
  401. new Float:Armour;
  402.  
  403. // Skip checking for hacks used by the player if he was reported by the Anti-Hack system already
  404. if (APlayerData[playerid][AutoReportTime] > 0)
  405. {
  406.  
  407. // Reduce the time so the player can be reported again soon if he doesn't stop using hacks
  408. APlayerData[playerid][AutoReportTime]--;
  409. // Exit the function, this skips the hack-checks until the AutoReportTime has reached 0
  410. // Otherwise the player is reported every half a second until he stops using hacks
  411. return 1;
  412. }
  413.  
  414.  
  415.  
  416. // Check if a filterscript gave some money (or took it) to the player
  417. if (GetPVarInt(playerid, "PVarMoney") != 0)
  418. {
  419.  
  420. // Add the money to the players account
  421. APlayerData[playerid][PlayerMoney] = APlayerData[playerid][PlayerMoney] + GetPVarInt(playerid, "PVarMoney");
  422. // Clear the PVar
  423. SetPVarInt(playerid, "PVarMoney", 0);
  424. }
  425. if (GetPVarInt(playerid, "PVarScore") != 0)
  426. {
  427.  
  428. // Add the money to the players account
  429. APlayerData[playerid][PlayerScore] = APlayerData[playerid][PlayerScore] + GetPVarInt(playerid, "PVarScore");
  430. // Clear the PVar
  431. SetPVarInt(playerid, "PVarScore", 0);
  432. }
  433.  
  434. // Reset the player's money and set it to the stored value in the player's account (do the same for scorepoints)
  435. ResetPlayerMoney(playerid);
  436. GivePlayerMoney(playerid, APlayerData[playerid][PlayerMoney]);
  437. SetPlayerScore(playerid, APlayerData[playerid][PlayerScore]);
  438.  
  439. // Limit the cash that the player can have
  440. if (APlayerData[playerid][PlayerMoney] > 1900000000)
  441. APlayerData[playerid][PlayerMoney] = 1900000000;
  442.  
  443. // Limit the cash that the player can have below 0
  444. if (APlayerData[playerid][PlayerMoney] < -1000000)
  445. APlayerData[playerid][PlayerMoney] = -1000000;
  446.  
  447. // Weapon hacks are also neutralized here, except for police players (if they are allowed to have weapons)
  448. if ((PoliceGetsWeapons == true) && (APlayerData[playerid][PlayerClass] == ClassPolice))
  449. {
  450.  
  451. // Do nothing
  452. }
  453. else
  454.  
  455.  
  456. GetPlayerArmour(playerid, Armour);
  457. if ((Armour > 1.0) && (APlayerData[playerid][PlayerLevel] < 1 && Player[playerid][VIP] == false))
  458. SendReportToAdmins(playerid, "Hack de Vida", true);
  459.  
  460. if (APlayerData[playerid][PlayerSpeed] > 263)
  461. {
  462. SendReportToAdmins(playerid, "Speed-hack", true);
  463. }
  464.  
  465. if (APlayerData[playerid][PlayerLevel] < 1 && Player[playerid][VIP] == false)
  466. {
  467. if (GetPlayerSpecialAction(playerid) == 2)
  468. SendReportToAdmins(playerid, "Jetpack-hack", true);
  469. }
  470.  
  471. if(APlayerData[playerid][PlayerLevel] < 1)
  472. {
  473. if (APlayerData[playerid][WeaponLicense] == 0)
  474. {
  475. switch (GetPlayerWeapon(playerid))
  476. {
  477. case 2, 4, 6..18, 23, 26, 27, 29, 31, 34, 35..42: return ResetPlayerWeapons(playerid);
  478. }
  479. }
  480. }
  481.  
  482. if (GetPlayerInterior(playerid) == 7) {
  483. ResetPlayerWeapons(playerid); }
  484.  
  485. if (APlayerData[playerid][PlayerScore] < 50)
  486. {
  487.  
  488. switch (GetPlayerWeapon(playerid))
  489. {
  490.  
  491. case 1..5, 6..22, 23..25, 26..42: return ResetPlayerWeapons(playerid);
  492. }
  493. }
  494.  
  495.  
  496. if (APlayerData[playerid][PlayerScore] < 400)
  497. {
  498.  
  499. // Let the player know he needs 100 scorepoints
  500. switch (GetPlayerWeapon(playerid))
  501. {
  502.  
  503. case 28,30: return ResetPlayerWeapons(playerid);
  504. }
  505. }
  506.  
  507. if (APlayerData[playerid][PlayerScore] < 800)
  508. {
  509.  
  510. // Let the player know he needs 100 scorepoints
  511. switch (GetPlayerWeapon(playerid))
  512. {
  513.  
  514. case 25,32: return ResetPlayerWeapons(playerid);
  515. }
  516. }
  517.  
  518. // Detect airbreak hack
  519. if (GetPlayerVehicleSeat(playerid) == 0)
  520. {
  521.  
  522. // Check if the player is nearly standing still
  523. if (APlayerData[playerid][PlayerSpeed] < 10)
  524. {
  525.  
  526. // Check if the player switched interior-id's
  527. if (GetPlayerInterior(playerid) != APlayerData[playerid][PreviousInt])
  528. {
  529.  
  530. // Check if the new interior is the normal world or any mod-shop
  531. switch (GetPlayerInterior(playerid))
  532. {
  533.  
  534. case 0, 1, 2, 3: // Check interiors 0, 1, 2 and 3 (normal world and all mod-shops)
  535. {
  536.  
  537. // Store the player's current location and interior-id for the next iteration
  538. GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);
  539. APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);
  540. // Exit the function
  541. return 1;
  542. }
  543. }
  544. }
  545.  
  546. // Check if the player is still near the same place he was half a second ago
  547. if (IsPlayerInRangeOfPoint(playerid, 7.5, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]))
  548. {
  549.  
  550. }
  551. else // Send an automated report to the admins so they're informed about it and can take action
  552. SendReportToAdmins(playerid, "Teleporte Hacker", true);
  553. }
  554. }
  555. // Store the player's current location and interior-id for the next iteration
  556. GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);
  557. APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);
  558.  
  559. return 1;
  560. }
Add Comment
Please, Sign In to add comment