SA-MP Forums Archive
Anti-NOP Hacks (Not accurate) - 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-NOP Hacks (Not accurate) (/showthread.php?tid=463536)



Anti-NOP Hacks (Not accurate) - Patrick - 12.09.2013

NOPHacksCheck Timer
pawn Code:
public OnGameModeInit()
{
SetTimer("NOPHacksCheck", 1000, true);
return 1;
}

NOPHacksCheck forward & public
pawn Code:
forward NOPHacksCheck(playerid);
public NOPHacksCheck(playerid)
{
    // NOP Vehicle Cheat
    new vehicleid = GetPlayerVehicleID(playerid);
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        if(IsLeoVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 1 || IsTruckerVehicle(vehicleid) && PlayerInfo[playerid][pJob] != JOB_TRUCKER)
        {
            new string[128];
            format(string, sizeof(string), "AdmWarn: %s(%d) might be Desynced or using NOP hacks. (Driving Restricted Vehicle - Vehicle Model: %d))", RPN(playerid), playerid, GetVehicleModel(vehicleid));
            SendAdminMessage(COLOR_DARKRED, 1, string);
            RemovePlayerFromVehicle(playerid);
        }
    }
    return 1;
}
Problem - Everytime someone enters a LEO or a Trucker vehicle without that faction/job, they can enter but it gives a warning to a innocent person who doesn't use NOP Hacks. I'm asking that how to make it accurate?, like it only gives a warning who DOES Actually use that hack. not those innocent person who can be banned mistakenly (which is pain in the ass and loosing players). If anyone can explain HOW I could improve and make it more accurate.



Re: Anti-NOP Hacks (Not accurate) - Jefff - 12.09.2013

pawn Code:
forward NOPHacksCheck();
public NOPHacksCheck()
{
    static MaxP;
    if(!MaxP)
        MaxP = GetMaxPlayers();

    // NOP Vehicle Cheat
    for(new playerid=0; playerid != MaxP; playerid++)
        if(IsPlayerConnected(playerid))
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            if(!(0 < vehicleid < MAX_VEHICLES)) continue;
            if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                if(IsLeoVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 1 || IsTruckerVehicle(vehicleid) && PlayerInfo[playerid][pJob] != JOB_TRUCKER)
                {
                    new string[128];
                    format(string, sizeof(string), "AdmWarn: %s(%d) might be Desynced or using NOP hacks. (Driving Restricted Vehicle - Vehicle Model: %d))", RPN(playerid), playerid, GetVehicleModel(vehicleid));
                    SendAdminMessage(COLOR_DARKRED, 1, string);
                    RemovePlayerFromVehicle(playerid);
                }
            }
        }

    return 1;
}



Re: Anti-NOP Hacks (Not accurate) - Patrick - 12.09.2013

Jeff can you explain HOW you made it accurate or what in the code made the anti-nop hacks accurate??

PS: I added your code and it still give me those warning even though I'm not using hacks


Re: Anti-NOP Hacks (Not accurate) - Jefff - 12.09.2013

Check OnPlayerEnterVehicle or OnPlayerStateChange and block player


Re: Anti-NOP Hacks (Not accurate) - Patrick - 12.09.2013

Block player what do you mean? I don't have any codes or variables about the NOP Hack Check on, OnPlayerStateChange or OnPlayerEnterVehicle, I'm thinking of adding a variable but I guess it's nothing.


Re: Anti-NOP Hacks (Not accurate) - Jefff - 12.09.2013

pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsLeoVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 1 || IsTruckerVehicle(vehicleid) && PlayerInfo[playerid][pJob] != JOB_TRUCKER)
    {
        TogglePlayerControllable(playerid,false);
        TogglePlayerControllable(playerid,true);
        return 0;
    }
    return 1;
}



Re: Anti-NOP Hacks (Not accurate) - RebeloX - 12.09.2013

Quote:
Originally Posted by Jefff
View Post
Check OnPlayerEnterVehicle or OnPlayerStateChange and block player
Jefff is right, check and block the player or remove from the vehicle.
Try to make a debug.


Re: Anti-NOP Hacks (Not accurate) - Patrick - 12.09.2013

@BlueX - Alright, I'll try to make a debug, and we'll see the results afterwards, I did block the player or remove from the vehicle.


Re: Anti-NOP Hacks (Not accurate) - Patrick - 12.09.2013

Debug Result


Debug shows on this code
pawn Code:
if(IsLeoVehicle(vehicleid) && PlayerInfo[playerid][pFac] != 1 || IsTruckerVehicle(vehicleid) && PlayerInfo[playerid][pJob] != JOB_TRUCKER)
            {
                new string[128];
                format(string, sizeof(string), "AdmWarn: %s(%d) might be Desynced or using NOP hacks. (Driving Restricted Vehicle - Vehicle Model: %d))", RPN(playerid), playerid, GetVehicleModel(vehicleid));
                SendAdminMessage(COLOR_DARKRED, 1, string);
                RemovePlayerFromVehicle(playerid);
                print("Debug 2 OnPlayerEnterVehicle");
            }



Re: Anti-NOP Hacks (Not accurate) - Patrick - 12.09.2013

Sorry for double posting, but I did some twicks and stuff on the script to be able to fix it but I can't fix it for some reason.