Anti-NOP Hacks (Not accurate)
#1

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.
Reply
#2

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;
}
Reply
#3

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
Reply
#4

Check OnPlayerEnterVehicle or OnPlayerStateChange and block player
Reply
#5

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.
Reply
#6

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;
}
Reply
#7

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.
Reply
#8

@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.
Reply
#9

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");
            }
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)