Anti AirBreak problem
#1

hey, i make this to check if is airbreaking but when is on top of the vehicle and it's going fast it will detect it as airbreak

Код:
public OnPlayerUpdate(playerid)
{
	new time = gettime();

	if(lastUserCheck[playerid] < time)
	{
		new string[129];
		lastUserCheck[playerid] = time;

		//Anti AirBreak
		if(gettime() > AntiABImmunity[playerid])
		{
			if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
			{
				if(!IsPlayerInRangeOfPoint(playerid, 20, PosX[playerid], PosY[playerid], PosZ[playerid]))
				{
					if(pInfo[playerid][pAdmin] == 0)
					{
						if(isfalling[playerid] == 0)
						{
							format(string, sizeof(string), "("dr"Cheats Log "w") %s(%d) is suspected of using AirBreak", pInfo[playerid][pName], playerid);
							ABroadCast(COLOR_WHITE, string, 1);
							Reported[playerid] = 1;
							format(Reportedfor[playerid], sizeof(string), "cheats"); 
							format(Reportedtext[playerid], sizeof(string), "%s [%d] - level %d - was reported for AirBreak by AdmBot.", pInfo[playerid][pName], playerid, pInfo[playerid][pLevel]);
						}
					}
				}
			}
			if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			{
				if(!IsPlayerInRangeOfPoint(playerid, 80, PosX[playerid], PosY[playerid], PosZ[playerid]))
				{
					if(pInfo[playerid][pAdmin] == 0)
					{
						if(isfalling[playerid] == 0)
						{
							format(string, sizeof(string), "("dr"Cheats Log "w") %s(%d) is suspected of using AirBreak", pInfo[playerid][pName], playerid);
							ABroadCast(COLOR_WHITE, string, 1);
							Reported[playerid] = 1;
							format(Reportedfor[playerid], sizeof(string), "cheats");
							format(Reportedtext[playerid], sizeof(string), "%s [%d] - level %d - was reported for AirBreak by AdmBot.", pInfo[playerid][pName], playerid, pInfo[playerid][pLevel]);
						}
					}
				}
			}
		}
         }
}
Reply
#2

You can check if the player it's on a vehicle with GetPlayerSurfingVehicleID(playerid);

https://sampwiki.blast.hk/wiki/GetPlayerSurfingVehicleID

Код:
if(GetPlayerSurfingVehicleID(playerid) == INVALID_VEHICLE_ID)
{
       //Send AirBreak Warnings.
}
Reply
#3

That's not safe to flag as airbreak just for that, there are more checks to be done and the fact that you used OPU for that is even worse, i'd like to suggest this:
https://sampforum.blast.hk/showthread.php?tid=649781

As it does way more better checks to detect in an advanced way and also detects teleport, good luck. And if you have any questions about it pm me and i'll gladly answer your doubts.
Reply
#4

Why it's a worse method to check if is airbreaking?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)