SA-MP Forums Archive
Checking for airbreak hack? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Checking for airbreak hack? (/showthread.php?tid=177920)



Checking for airbreak hack? - The_Moddler - 19.09.2010

I've seen in some servers the automatic detection of airbreak.. I wonder how to do it..
Thanks guys


Re: Checking for airbreak hack? - Zack9764 - 19.09.2010

Код:
//If the player is more than 10 meters above the ground, and not in a vehicle, then ban the player.
//(More than 100 meters off the ground for all non-planes/helis) - Player could go off jumps
#pragma tabsize 0

#include <a_samp>
#include <mapandreas>
#include <foreach> 	// ForEach Loop
#include "../include/gl_common.inc"

forward AirBreak();

IsVehicleAir(playerid, vehicleid)
{
	vehicleid = GetPlayerVehicleID(playerid);
	switch(GetVehicleModel(vehicleid))
	{
		case 592, 577, 511, 512, 593, 520, 553, 476, 519, 460, 513, 548, 425, 417, 487, 488, 498, 563, 447, 469: return true;
	}
	return false;
}

public AirBreak()
{
	foreach (Player, i)
	{
  		new Float:X, Float:Y, Float:Z, Float:ZM, Float:difference;
		GetPlayerPos(i,X,Y,Z); //Get the players position
	 	MapAndreas_FindZ_For2DCoord(X,Y,ZM); //Gets the max Z cord
		difference = Z-ZM;
		
	 	if(!IsVehicleAir(i, GetPlayerVehicleID(i)))
		{
  			if (difference > 100 && GetPlayerState(i) == PLAYER_STATE_PASSENGER || GetPlayerState(i) == PLAYER_STATE_DRIVER)
			{
				//Do something here, like send a warning to admins or ban the player
			}
			//If players Z cord is more than 100 meters above the ground
			if(difference > 10 && GetPlayerState(i) == PLAYER_STATE_ONFOOT)
			{
				//Do something here, like send a warning to admins or ban the playe
			}
		}
	}
}



Re: Checking for airbreak hack? - [HiC]TheKiller - 19.09.2010

Using a numerous number of GetVehicleVelocity checks. Firstly make sure you know how fast the max speed for the vehicle is and if it's too high over that then he is probably airbreaking.