Advertisement
Guest User

Speedometer (By: Pedex)

a guest
Oct 12th, 2014
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.10 KB | None | 0 0
  1. // Forward the function needed to update the speedometer (used by a timer)
  2. forward Speedometer_Update(playerid);
  3. forward RefuelVehicle(playerid);
  4.  
  5. // This function sets up the speedometer for the given player
  6. Speedometer_Setup(playerid)
  7. {
  8. // Setup the speedometer for the player
  9. APlayerData[playerid][SpeedometerText] = TextDrawCreate(500.0, 395.0, " ");
  10. APlayerData[playerid][FuelGauge] = TextDrawCreate(500.0, 410.0, " ");
  11. // Enable the TextDraw for this player
  12. TextDrawShowForPlayer(playerid, APlayerData[playerid][SpeedometerText]);
  13. TextDrawShowForPlayer(playerid, APlayerData[playerid][FuelGauge]);
  14.  
  15. APlayerData[playerid][Latariaaa] = TextDrawCreate(479.000000, 406.000000, " "); // Sem estar escrito nada
  16. TextDrawBackgroundColor(APlayerData[playerid][Latariaaa], 255);
  17. TextDrawLetterSize(APlayerData[playerid][Latariaaa], 0.449999, 1.599998);
  18. TextDrawColor(APlayerData[playerid][Latariaaa], -1);
  19. TextDrawSetOutline(APlayerData[playerid][Latariaaa], 1);
  20. TextDrawSetProportional(APlayerData[playerid][Latariaaa], 1);
  21.  
  22. TextDrawShowForPlayer(playerid, APlayerData[playerid][Latariaaa]);
  23.  
  24. APlayerData[playerid][SpeedometerTimer] = SetTimerEx("Speedometer_Update", 100, true, "i", playerid);
  25. return 1;
  26. }
  27.  
  28. // This function cleans up the speedometer for the given player
  29. Speedometer_Cleanup(playerid)
  30. {
  31. // Destroy the speedometer textdraw
  32. TextDrawDestroy(APlayerData[playerid][SpeedometerText]);
  33. TextDrawDestroy(APlayerData[playerid][FuelGauge]);
  34. TextDrawDestroy(APlayerData[playerid][Latariaaa]);
  35. // Kill the speedometer timer
  36. KillTimer(APlayerData[playerid][SpeedometerTimer]);
  37. // Set player speed to 0
  38. APlayerData[playerid][PlayerSpeed] = 0;
  39.  
  40. return 1;
  41. }
  42.  
  43. // This function gets called by a timer which runs every 500ms to display and update the speedometer
  44. public Speedometer_Update(playerid)
  45. {
  46. // Setup local variables
  47. new vehicleid, Float:speed_x, Float:speed_y, Float:speed_z, Float:final_speed, speed_string[50], final_speed_int, Float:vehiclehealth;
  48. new FuelString[50], FuelStatus[20];
  49. new Msg[128], Name[24];
  50.  
  51. // Get the ID of the player's vehicle
  52. vehicleid = GetPlayerVehicleID(playerid);
  53.  
  54. //******************************************************************************************************************************
  55. // Anti-hack stuff
  56. //******************************************************************************************************************************
  57.  
  58. // exclude NPC from AntiHack
  59. if (IsPlayerNPC(playerid) == 0)
  60. AntiHack(playerid);
  61.  
  62. //******************************************************************************************************************************
  63. // End of anti-hack stuff
  64. //******************************************************************************************************************************
  65.  
  66. // Check and toggle spectate-mode when needed (when target player entered or exited his vehicle)
  67. if (GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
  68. {
  69. // Get the target player's ID and name
  70. new OtherPlayer = APlayerData[playerid][SpectateID];
  71. GetPlayerName(OtherPlayer, Name, sizeof(Name));
  72.  
  73. // Use the same worldid and interiorid as the OtherPlayer
  74. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(OtherPlayer));
  75. SetPlayerInterior(playerid, GetPlayerInterior(OtherPlayer));
  76.  
  77. // Check if the player is spectating a player
  78. if (APlayerData[playerid][SpectateType] == ADMIN_SPEC_TYPE_PLAYER)
  79. {
  80. // Check if the target player has entered a vehicle
  81. if (GetPlayerVehicleSeat(OtherPlayer) != -1)
  82. {
  83. // Change spectate mode to vehicle
  84. PlayerSpectateVehicle(playerid, GetPlayerVehicleID(OtherPlayer));
  85. APlayerData[playerid][SpectateID] = OtherPlayer;
  86. APlayerData[playerid][SpectateVehicle] = GetPlayerVehicleID(OtherPlayer);
  87. APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_VEHICLE;
  88. format(Msg, 128, "{00FF00}O Jogador {FFFF00}%s{00FF00} Entrou no Veículo, Trocando o Modo de espiar...", Name);
  89. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  90. }
  91. }
  92. else // The player is spectating a vehicle
  93. {
  94. // Check if the target player has exited a vehicle
  95. if (GetPlayerVehicleSeat(OtherPlayer) == -1)
  96. {
  97. // Change spectate mode to player
  98. PlayerSpectatePlayer(playerid, OtherPlayer);
  99. SetPlayerInterior(playerid, GetPlayerInterior(OtherPlayer));
  100. APlayerData[playerid][SpectateID] = OtherPlayer;
  101. APlayerData[playerid][SpectateType] = ADMIN_SPEC_TYPE_PLAYER;
  102. format(Msg, 128, "{00FF00}O Jogador {FFFF00}%s{00FF00} Saiu do Veículo, Trocando o Modo de espiar...", Name);
  103. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  104. }
  105. }
  106. }
  107.  
  108. // When the player got a wanted level and a police player warned him to stop, a timer is started and a variable is set to "true"
  109. // Check if this variable has been set
  110. if (APlayerData[playerid][PoliceWarnedMe] == true)
  111. {
  112. // Check if the player has no wanted level anymore (after finishing a overloaded mission, player got fined, ...)
  113. if (GetPlayerWantedLevel(playerid) == 0)
  114. {
  115. APlayerData[playerid][PoliceCanJailMe] = false; // Clear the variable
  116. APlayerData[playerid][PoliceWarnedMe] = false; // Clear the variable
  117. APlayerData[playerid][Value_PoliceCanJailMe] = 0; // Clear the remaining time for the timer
  118. KillTimer(APlayerData[playerid][Timer_PoliceCanJailMe]); // Kill the timer
  119. }
  120. }
  121.  
  122. // If the player is inside a vehicle
  123. if(vehicleid != 0)
  124. {
  125. new Float:Vida;// Variavel da vida
  126. GetVehicleHealth(GetPlayerVehicleID(playerid), Vida); // getando a vida
  127. /*------------------------------------------------------------------------------
  128. Lataria
  129. ------------------------------------------------------------------------------*/
  130. new ss[50];
  131. if ((Vida > 0) && (Vida < 1000))
  132. format(ss, 50, "~w~Lataria: ~w~I~r~.........", Vida);
  133.  
  134. if ((Vida >= ((1000 / 10) * 1)) && (Vida < ((1000 / 10) * 2)))
  135. format(ss, 50, "~w~Lataria: ~w~II~r~........", Vida);
  136.  
  137. if ((Vida >= ((1000 / 10) * 2)) && (Vida < ((1000 / 10) * 3)))
  138. format(ss, 50, "~w~Lataria: ~w~III~r~.......", Vida);
  139.  
  140. if ((Vida >= ((1000 / 10) * 3)) && (Vida < ((1000 / 10) * 4)))
  141. format(ss, 50, "~w~Lataria: ~w~IIII~r~......", Vida);
  142.  
  143. if ((Vida >= ((1000 / 10) * 4)) && (Vida < ((1000 / 10) * 5)))
  144. format(ss, 50, "~w~Lataria: ~w~IIIII~r~.....", Vida);
  145.  
  146. if ((Vida >= ((1000 / 10) * 5)) && (Vida < ((1000 / 10) * 6)))
  147. format(ss, 50, "~w~Lataria: ~w~IIIIII~r~....", Vida);
  148.  
  149. if ((Vida >= ((1000 / 10) * 6)) && (Vida < ((1000 / 10) * 7)))
  150. format(ss, 50, "~w~Lataria: ~w~IIIIIII~r~...", Vida);
  151.  
  152. if ((Vida >= ((1000 / 10) * 7)) && (Vida < ((1000 / 10) * 8)))
  153. format(ss, 50, "~w~Lataria: ~w~IIIIIIII~r~..", Vida);
  154.  
  155. if ((Vida >= ((1000 / 10) * 8)) && (Vida < ((1000 / 10) * 9)))
  156. format(ss, 50, "~w~Lataria: ~w~IIIIIIIII~r~.", Vida);
  157.  
  158. if ((Vida >= ((1000 / 10) * 9)) && (Vida <= 1000))
  159. format(ss, 50, "~w~Lataria: ~w~IIIIIIIIII", Vida);
  160.  
  161. if (Vida == 0)
  162. format(ss, 50, "~w~Lataria: ~r~..........", Vida);
  163.  
  164. TextDrawSetString(APlayerData[playerid][Latariaaa], ss); // atualizando a textdraw
  165.  
  166. // Get the vehicles velocity
  167. GetVehicleVelocity(vehicleid, speed_x, speed_y, speed_z);
  168. // Calculate the speed (in kph)
  169. final_speed = floatsqroot(((speed_x * speed_x) + (speed_y * speed_y)) + (speed_z * speed_z)) * 158.179;
  170. // Convert the float value to an int value
  171. final_speed_int = floatround(final_speed, floatround_round);
  172. // Also save the speed for the player
  173. APlayerData[playerid][PlayerSpeed] = final_speed_int;
  174. // Setup the string to display for the player and display it
  175. format(speed_string, 50, TXT_SpeedometerSpeed, final_speed_int);
  176. TextDrawSetString(APlayerData[playerid][SpeedometerText], speed_string);
  177.  
  178. // Add the speed to the stats (this will be the meters driven in total)
  179. APlayerData[playerid][StatsMetersDriven] = APlayerData[playerid][StatsMetersDriven] + (final_speed / 7.2);
  180.  
  181. // Also display the vehicle's health through the player-health bar
  182. GetVehicleHealth(vehicleid, vehiclehealth);
  183. SetPlayerHealth(playerid, vehiclehealth / 10.0);
  184.  
  185. // Check if the speed is above 10kph and the fuel of the vehicle isn't empty yet
  186. if ((final_speed_int > 10) && (AVehicleData[vehicleid][Fuel] > 0))
  187. AVehicleData[vehicleid][Fuel] = AVehicleData[vehicleid][Fuel] - 1; // Decrease the fuel for this vehicle every time the timer is run
  188.  
  189. // Construct the fuelgauge
  190. if ((AVehicleData[vehicleid][Fuel] > 0) && (AVehicleData[vehicleid][Fuel] < 100000))
  191. format(FuelStatus, 20, "~g~%s~r~%s", "I", "IIIIIIIII"); // Fuel is between 0% and 10% full
  192.  
  193. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 1)) && (AVehicleData[vehicleid][Fuel] < ((MaxFuel / 10) * 2)))
  194. format(FuelStatus, 20, "~g~%s~r~%s", "II", "IIIIIIII"); // Fuel is between 10% and 20% full
  195.  
  196. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 2)) && (AVehicleData[vehicleid][Fuel] < ((MaxFuel / 10) * 3)))
  197. format(FuelStatus, 20, "~g~%s~r~%s", "III", "IIIIIII"); // Fuel is between 20% and 30% full
  198.  
  199. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 3)) && (AVehicleData[vehicleid][Fuel] < ((MaxFuel / 10) * 4)))
  200. format(FuelStatus, 20, "~g~%s~r~%s", "IIII", "IIIIII"); // Fuel is between 30% and 40% full
  201.  
  202. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 4)) && (AVehicleData[vehicleid][Fuel] < ((MaxFuel / 10) * 5)))
  203. format(FuelStatus, 20, "~g~%s~r~%s", "IIIII", "IIIII"); // Fuel is between 40% and 50% full
  204.  
  205. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 5)) && (AVehicleData[vehicleid][Fuel] < ((MaxFuel / 10) * 6)))
  206. format(FuelStatus, 20, "~g~%s~r~%s", "IIIIII", "IIII"); // Fuel is between 50% and 60% full
  207.  
  208. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 6)) && (AVehicleData[vehicleid][Fuel] < ((MaxFuel / 10) * 7)))
  209. format(FuelStatus, 20, "~g~%s~r~%s", "IIIIIII", "III"); // Fuel is between 60% and 70% full
  210.  
  211. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 7)) && (AVehicleData[vehicleid][Fuel] < ((MaxFuel / 10) * 8)))
  212. format(FuelStatus, 20, "~g~%s~r~%s", "IIIIIIII", "II"); // Fuel is between 70% and 80% full
  213.  
  214. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 8)) && (AVehicleData[vehicleid][Fuel] < ((MaxFuel / 10) * 9)))
  215. format(FuelStatus, 20, "~g~%s~r~%s", "IIIIIIIII", "I"); // Fuel is between 80% and 90% full
  216.  
  217. if ((AVehicleData[vehicleid][Fuel] >= ((MaxFuel / 10) * 9)) && (AVehicleData[vehicleid][Fuel] <= MaxFuel))
  218. format(FuelStatus, 20, "~g~%s", "IIIIIIIIII"); // Fuel is between 90% and 100% full (all bars are green)
  219.  
  220. if (AVehicleData[vehicleid][Fuel] == 0)
  221. format(FuelStatus, 20, "~r~%s", "IIIIIIIIII"); // Fuel is empty (all bars are red)
  222.  
  223. // Format the final fuel-gauge readout
  224. format(FuelString, 50, TXT_SpeedometerFuel, FuelStatus);
  225. // Display the fuel-gauge
  226. TextDrawSetString(APlayerData[playerid][FuelGauge], FuelString);
  227.  
  228. // Check if the vehicle is out of fuel
  229. if (AVehicleData[vehicleid][Fuel] == 0)
  230. {
  231. // Stop the engine and turn off the lights
  232. new engine,lights,alarm,doors,bonnet,boot,objective;
  233. GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  234. SetVehicleParamsEx(vehicleid, 0, 0, alarm, doors, bonnet, boot, objective);
  235. }
  236.  
  237. // Check if the player is not in any plane or helicopter (those cannot be caught by speedcamera's)
  238. if (IsVehicleAirVehicle(vehicleid) == 0)
  239. if (APlayerData[playerid][PlayerClass] != ClassPolice) // Check if the player isn't speeding (cops won't get caught)
  240. CheckPlayerSpeeding(playerid);
  241. }
  242. else
  243. {
  244. // If the player is not inside a vehicle, display an empty string (looks like the speedometer is gone)
  245. TextDrawSetString(APlayerData[playerid][SpeedometerText], " ");
  246. TextDrawSetString(APlayerData[playerid][FuelGauge], " ");
  247. TextDrawSetString(APlayerData[playerid][Latariaaa], " ");
  248. // Set the speed of the player to 0
  249. APlayerData[playerid][PlayerSpeed] = 0;
  250. }
  251. }
  252.  
  253.  
  254.  
  255. // This timer-function is called when a player picks up a refuelpickup
  256. public RefuelVehicle(playerid)
  257. {
  258. new RefuelMsg[128];
  259. // Get the vehicle-id of the player's vehicle
  260. new vID = GetPlayerVehicleID(playerid);
  261. // Calculate the amount of fuel that needs to be refuelled
  262. new Amount = MaxFuel - AVehicleData[vID][Fuel];
  263. // Calculate the price to refuel
  264. new RefuelPrice = (Amount * RefuelMaxPrice) / MaxFuel;
  265.  
  266. // Check if the player has enough cash
  267. if (APlayerData[playerid][PlayerMoney] >= RefuelPrice)
  268. {
  269. // Refuel the vehicle
  270. AVehicleData[vID][Fuel] = MaxFuel;
  271. // Withdraw the money from the player
  272. RewardPlayer(playerid, -RefuelPrice, 0);
  273. // Let the player know he refuelled his vehicle
  274. format(RefuelMsg, 128, TXT_RefuelledVehicle, RefuelPrice);
  275. SendClientMessage(playerid, 0xFFFFFFFF, RefuelMsg);
  276. }
  277. else
  278. SendClientMessage(playerid, 0xFFFFFFFF, TXT_CannotRefuelVehicle);
  279.  
  280. // Allow the player to move again
  281. TogglePlayerControllable(playerid, 1);
  282.  
  283. return 1;
  284. }
  285.  
  286.  
  287.  
  288. // This function checks if the player is speeding near a speedcamera
  289. CheckPlayerSpeeding(playerid)
  290. {
  291. // Setup local variables
  292. new Name[24], Msg[128];
  293.  
  294. // Check if the player hasn't been caught speeding recently
  295. if (APlayerData[playerid][PlayerCaughtSpeeding] == 0)
  296. {
  297. // Loop through all speedcameras
  298. for (new CamID; CamID < MAX_CAMERAS; CamID++)
  299. {
  300. // Check if this camera has been created
  301. if (ACameras[CamID][CamSpeed] != 0)
  302. {
  303. // Check if the player is the driver of the vehicle
  304. if (GetPlayerVehicleSeat(playerid) == 0)
  305. {
  306. // 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)
  307. if (APlayerData[playerid][PlayerSpeed] > ACameras[CamID][CamSpeed])
  308. {
  309. // Check if the player is near the camera
  310. if (IsPlayerInRangeOfPoint(playerid, 50.0, ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ]))
  311. {
  312. // Prevent the player being caught multiple times by the same speed-camera
  313. APlayerData[playerid][PlayerCaughtSpeeding] = 20;
  314. // Increase the wanted-level of this player by 1 star
  315. SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
  316. // Let the player know he's been caught speeding
  317. SendClientMessage(playerid, 0xFFFFFFFF, TXT_PlayerCaughtSpeeding);
  318.  
  319. // Get the name of the player
  320. GetPlayerName(playerid, Name, sizeof(Name));
  321. // Also inform all police players that this player is caught speeding
  322. format(Msg, 128, "{00FF00}O Jogador {FF0000}%s{00FF00} Foi Pego Correndo, Persiga e Multe-o", Name);
  323. Police_SendMessage(Msg);
  324. }
  325. }
  326. }
  327. }
  328. }
  329. }
  330. else // If the player has been caught before, reduce the value until it's 0 again, then he can be caught again
  331. APlayerData[playerid][PlayerCaughtSpeeding]--;
  332. }
  333.  
  334.  
  335.  
  336. // This function processes anti-hack stuff
  337. stock AntiHack(playerid)
  338. {
  339. // Setup local variables
  340. new Float:Armour;
  341.  
  342. // Skip checking for hacks used by the player if he was reported by the Anti-Hack system already
  343. if (APlayerData[playerid][AutoReportTime] > 0)
  344. {
  345. // Reduce the time so the player can be reported again soon if he doesn't stop using hacks
  346. APlayerData[playerid][AutoReportTime]--;
  347. // Exit the function, this skips the hack-checks until the AutoReportTime has reached 0
  348. // Otherwise the player is reported every half a second until he stops using hacks
  349. return 1;
  350. }
  351.  
  352.  
  353.  
  354. // Check if a filterscript gave some money (or took it) to the player
  355. if (GetPVarInt(playerid, "PVarMoney") != 0)
  356. {
  357. // Add the money to the players account
  358. APlayerData[playerid][PlayerMoney] = APlayerData[playerid][PlayerMoney] + GetPVarInt(playerid, "PVarMoney");
  359. // Clear the PVar
  360. SetPVarInt(playerid, "PVarMoney", 0);
  361. }
  362. if (GetPVarInt(playerid, "PVarScore") != 0)
  363. {
  364. // Add the money to the players account
  365. APlayerData[playerid][PlayerScore] = APlayerData[playerid][PlayerScore] + GetPVarInt(playerid, "PVarScore");
  366. // Clear the PVar
  367. SetPVarInt(playerid, "PVarScore", 0);
  368. }
  369.  
  370. // Reset the player's money and set it to the stored value in the player's account (do the same for scorepoints)
  371. ResetPlayerMoney(playerid);
  372. GivePlayerMoney(playerid, APlayerData[playerid][PlayerMoney]);
  373. SetPlayerScore(playerid, APlayerData[playerid][PlayerScore]);
  374.  
  375. // Limit the cash that the player can have
  376. if (APlayerData[playerid][PlayerMoney] > 999000000)
  377. APlayerData[playerid][PlayerMoney] = 999000000;
  378.  
  379. // Limit the cash that the player can have below 0
  380. if (APlayerData[playerid][PlayerMoney] < -1000000)
  381. APlayerData[playerid][PlayerMoney] = -1000000;
  382.  
  383. // Port anyone out of the area who is not an admin and inside the area 69
  384. Player_PortOutAdminZone(playerid, 106.0, 1805.0, -50.0, 285.0, 1940.0, 40.0, 15.0, 1732.0, 25.0);
  385.  
  386. // Weapon hacks are also neutralized here, except for police players (if they are allowed to have weapons)
  387. if ((PoliceGetsWeapons == true) && (APlayerData[playerid][PlayerClass] == ClassPolice))
  388. {
  389. // Do nothing
  390. }
  391. else // Extended check to allow parachute
  392. {
  393. if (GetPlayerWeapon(playerid) != 46) // Check if the current weapons isn't a parachute (ID: 46)
  394. ResetPlayerWeapons(playerid); // If it's not, remove weapon
  395. }
  396.  
  397. // Check if the player got any armour (= health-hack)
  398. GetPlayerArmour(playerid, Armour);
  399. // Send an automated report to the admins so they're informed about it and can take action
  400. if (Armour > 1.0)
  401. SendReportToAdmins(playerid, "Health-hack", true);
  402.  
  403. // Check if the speed is higher than 300 (kick player if it is)
  404. // Send an automated report to the admins so they're informed about it and can take action
  405. if (APlayerData[playerid][PlayerSpeed] > 300)
  406. SendReportToAdmins(playerid, "Speed-hack", true);
  407.  
  408. // Check if the player is not allowed to have a jetpack (admins lvl 3 and higher can use /fly, so they will be excluded)
  409. if (APlayerData[playerid][PlayerLevel] < 3)
  410. {
  411. // Check if the player is using a jetpack
  412. // Send an automated report to the admins so they're informed about it and can take action
  413. if (GetPlayerSpecialAction(playerid) == 2)
  414. SendReportToAdmins(playerid, "Jetpack-hack", true);
  415. }
  416.  
  417. // Detect airbreak hack
  418. if (GetPlayerVehicleSeat(playerid) == 0)
  419. {
  420. // Check if the player is nearly standing still
  421. if (APlayerData[playerid][PlayerSpeed] < 10)
  422. {
  423. // Check if the player switched interior-id's
  424. if (GetPlayerInterior(playerid) != APlayerData[playerid][PreviousInt])
  425. {
  426. // Check if the new interior is the normal world or any mod-shop
  427. switch (GetPlayerInterior(playerid))
  428. {
  429. case 0, 1, 2, 3: // Check interiors 0, 1, 2 and 3 (normal world and all mod-shops)
  430. {
  431. // Store the player's current location and interior-id for the next iteration
  432. GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);
  433. APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);
  434. // Exit the function
  435. return 1;
  436. }
  437. }
  438. }
  439.  
  440. // Check if the player is still near the same place he was half a second ago
  441. if (IsPlayerInRangeOfPoint(playerid, 7.5, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]))
  442. {
  443. }
  444. else // Send an automated report to the admins so they're informed about it and can take action
  445. SendReportToAdmins(playerid, "Airbreak-hack", true);
  446. }
  447. }
  448. // Store the player's current location and interior-id for the next iteration
  449. GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);
  450. APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);
  451.  
  452. return 1;
  453. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement