SA-MP Forums Archive
[FilterScript] [FS] Anti-Airbreak Proof of Concept ( Using MapAndreas plugin ) - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] [FS] Anti-Airbreak Proof of Concept ( Using MapAndreas plugin ) (/showthread.php?tid=121444)



[FS] Anti-Airbreak Proof of Concept ( Using MapAndreas plugin ) - StunTEvo - 17.01.2010

This is a simple proof of concept anti-airbreak that I made. It works by getting the players Z position, and if it is a certain distance higher than the ground height, then you can do something.

An issue I couldn't figure out for the time, is that if a player goes off a massive jump, or jumps off a massivly high building, then they will be above the ground like a hacker would be. This issue makes this just a proof of concept.

Note: This filterscript requires the MapAndreas plugin. It also requires the foreach include.

Code:
//Simple Anti-Airbreak
//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();

public OnFilterScriptInit()
{
	print("\nAnti-AirBreak Loaded\n");
	MapAndreas_Init(MAP_ANDREAS_MODE_FULL);
	SetTimer("AirBreak", 2900, true);
	return 1;
}

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: [FS] Anti-Airbreak Proof of Concept ( Using MapAndreas plugin ) - [KMA]Lord_Deji - 17.01.2010

another issue is when i type /dive or /cardive on my server it send me +500 Z position

also what would happen if someone is simply on a map witch is above, like a big jump


Re: [FS] Anti-Airbreak Proof of Concept ( Using MapAndreas plugin ) - ¤Adas¤ - 17.01.2010

And what about positions in interiors and mount chilliad? How can you fix it? And why to ban player when he is only a passenger?


Re: [FS] Anti-Airbreak Proof of Concept ( Using MapAndreas plugin ) - Chaprnks - 17.01.2010

The only problem with this would be jumps, stunting, ect. Any possible way of getting 100 feet above the ground in a vehicle. (Bug, or on purpose.)


Re: [FS] Anti-Airbreak Proof of Concept ( Using MapAndreas plugin ) - notime - 17.01.2010

Quote:
Originally Posted by chytrak
see this

Code:
new
Float:Velocity[3];
	
if (IsPlayerInAnyVehicle(playerid))
{
GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0], Velocity[1], Velocity[2]);
if (Velocity[0] == 0.000000 && Velocity[1] == 0.000000)
{
SendClientMessage(playerid, COLOR, "OMFG Shutdown aibreak noob!");
}
}
+ check speed.
wait that actually works? i thought the vehicle did have a velocity if hes airbreaking.
well, now i know different, thanks

btw, nice FS StunTEvo


Re: [FS] Anti-Airbreak Proof of Concept ( Using MapAndreas plugin ) - StunTEvo - 17.01.2010

Quote:
Originally Posted by ¤Adas¤
And what about positions in interiors and mount chilliad? How can you fix it? And why to ban player when he is only a passenger?
Mt. Chilliad is a ground level. You can make an exception if someone is in an interior.

Quote:
Originally Posted by [KMA
Lord_Deji ]
another issue is when i type /dive or /cardive on my server it send me +500 Z position

also what would happen if someone is simply on a map witch is above, like a big jump
You could also add exceptions to if there just at a jump or something, or using something like /dive or /cardive