Anti AirBreak problem - 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)
+--- Thread: Anti AirBreak problem (
/showthread.php?tid=650264)
Anti AirBreak problem -
C0oL3r - 24.02.2018
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]);
}
}
}
}
}
}
}
Re: Anti AirBreak problem -
kingmk - 24.02.2018
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.
}
Re: Anti AirBreak problem -
RogueDrifter - 24.02.2018
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.
Re: Anti AirBreak problem -
C0oL3r - 24.02.2018
Why it's a worse method to check if is airbreaking?