Airbreak detection anti-hack
#1

I have the Anti-hack script from PPC_Trucking.

But now, I want, if players aren't in a car, the "auto-report" also shows up if they airbreak.

code now:

pawn Код:
// Detect airbreak hack
    if (GetPlayerVehicleSeat(playerid) == 0) // line where the guy is in car
    {
        // Check if the player is nearly standing still
        if (APlayerData[playerid][PlayerSpeed] < 10)
        {
            // Check if the player switched interior-id's
            if (GetPlayerInterior(playerid) != APlayerData[playerid][PreviousInt])
            {
                // Check if the new interior is the normal world or any mod-shop
                switch (GetPlayerInterior(playerid))
                {
                    case 0, 1, 2, 3: // Check interiors 0, 1, 2 and 3 (normal world and all mod-shops)
                    {
                        // Store the player's current location and interior-id for the next iteration
                        GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);
                        APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);
                        // Exit the function
                        return 1;
                    }
                }
            }

            // Check if the player is still near the same place he was half a second ago
            if (IsPlayerInRangeOfPoint(playerid, 20.0, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]))
            {
            }
            else // Send an automated report to the admins so they're informed about it and can take action
                SendReportToAdmins(playerid, "Airbreak-hack", true);
        }
    }
    // Store the player's current location and interior-id for the next iteration
    GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);
    APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);

    return 1;
}
Anyone has a idea? On how-to?
Reply
#2

Late-bump
Reply
#3

Maybe use the same thing that you used for detecting vehicle airbreak, except don't use the vehicle lines:

pawn Код:
if (GetPlayerVehicleSeat(playerid) == 0)
And use the rest in:
pawn Код:
public OnPlayerUpdate(playerid)
{
        if (APlayerData[playerid][PlayerSpeed] < 10)
        {
            // Check if the player switched interior-id's
            if (GetPlayerInterior(playerid) != APlayerData[playerid][PreviousInt])
            {
                // Check if the new interior is the normal world or any mod-shop
                switch (GetPlayerInterior(playerid))
                {
                    case 0, 1, 2, 3: // Check interiors 0, 1, 2 and 3 (normal world and all mod-shops)
                    {
                        // Store the player's current location and interior-id for the next iteration
                        GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);
                        APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);
                        // Exit the function
                        return 1;
                    }
                }
            }

            // Check if the player is still near the same place he was half a second ago
            if (IsPlayerInRangeOfPoint(playerid, 20.0, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]))
            {
            }
            else // Send an automated report to the admins so they're informed about it and can take action
                SendReportToAdmins(playerid, "Airbreak-hack", true);
        }
    }
    // Store the player's current location and interior-id for the next iteration
    GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);
    APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);

    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)