Anti Nitro Hack
#1

How to how to detect nitro hackers?

Example:
pawn Код:
//This is working if you add nitro in Transfender.
//Buy if you hack nitro, it is not working
// :S
dcmd_check(playerid, params[])
{
    #pragma unused params
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You is not in any vehicle");
    {
        new vehicleid;
        vehicleid = GetPlayerVehicleID(playerid);
        if(GetVehicleComponentInSlot(vehicleid, GetVehicleComponentType(1010)) == 1010)
        {
            SendClientMessage(playerid, 0xFF0000FF, "This vehicle has nitro");
            SendClientMessage(playerid, 0xFF0000FF, "You banned urself for nos hacking");
            BanEx(playerid, "Nos Hacker");
            return 1;
        }
        else
        {
            SendClientMessage(playerid, 0xFF0000FF, "This vehicle dont have nitro");
            return 1;
        }
    }
}
Reply
#2

Why to make it in a command?
Reply
#3

Quote:
Originally Posted by admantis
Посмотреть сообщение
Why to make it in a command?
It is just an example.. but the point is..
1. If i hack nitro then ill type /check then it dont work...
2. If i go to Transfender and add nos then ill type /check, then it work...
Reply
#4

For ex. you can set timer which will controll every car occupied by an player, define it's ID into variable and controll if the car has or hasn't got a nitro. If hasn't - Nitro = 0;, if has a Nitro, and previously it was 0 and is not in around Transfender, he's hacking.
Something like that:

Код:
new Nitro[MAX_PLAYERS];
new pCar[MAX_PLAYERS]; (players car)

//OnPlayerConnect
Nitro[playerid] = 0; pCar[playerid] = 0;

//OnGameModeInit
SetTimer("Check", 5000, 1);

public Check() {
	for(new i=0;i<MAX_PLAYERS;i+=1) {
	    if(IsPlayerConnected(i)) {
	        if(IsPlayerInAnyVehicle(i))
	        {
	            if(GetPlayerVehicleID(playerid) == pCar[i]) {
	                if(Nitro[i] == 0 && GetVehicleComponentInSlot(pCar[i], GetVehicleComponentType(1010)) == 1010) {
	                    if(!IsPlayerInRange(i, TRANSFENDR POSITIONS))
	                    {
	                        //Is Hacking
		                    SendClientMessage(i, #FFFFFF, 'You suck man!');
		                    Kick(i);
	                    } else { Nitro[i] = 1; }
	                }
	            }
	            else {
	                pCar[i] = GetPlayerVehicleID(i);
					if(GetVehicleComponentInSlot(pCar[i], GetVehicleComponentType(1010)) == 1010)
					{
						Nitro[i] = 1;
					}
					else {
						Nitro[i] = 0;
					}
	            }
	        }
	    }
	}
}
Reply
#5

Not working =/

I hacked nitro far away from Transfender and i didnt get kicked
Reply
#6

And did you add a position into IsPlayerInRange? Did you set the timer? Do you use that variables?
You must check if everything looks properly before you test it, logically it should work but I didn't test it...
Show me the code you've used.
Reply
#7

:S

pawn Код:
new Nitro[MAX_PLAYERS];
new pCar[MAX_PLAYERS];

forward Check();

public OnPlayerConnect(playerid)
{
    Nitro[playerid] = 0;
    pCar[playerid] = 0;
    return 1;
}

public OnFilterScriptInit()
{
    SetTimer("Check", 5000, 1);
    return 1;
}

public Check()
{
    for(new i=0;i<MAX_PLAYERS;i+=1)
    {
        if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
        {
            if(GetPlayerVehicleID(i) == pCar[i])
            {
                if(Nitro[i] == 0 && GetVehicleComponentInSlot(pCar[i], GetVehicleComponentType(1010)) == 1010)
                {
                    if(!IsPlayerInRangeOfPoint(i, 30, 617.1921,0.0100,1000.9219)) //To the interior
                    {
                        //Is Hacking
                        SendClientMessage(i, 0xFF0000FF, "You suck man!");
                        Kick(i);
                    }
                    else
                    {
                        Nitro[i] = 1;
                    }
                }
            }
            else
            {
                pCar[i] = GetPlayerVehicleID(i);
                if(GetVehicleComponentInSlot(pCar[i], GetVehicleComponentType(1010)) == 1010)
                {
                    Nitro[i] = 1;
                }
                else
                {
                    Nitro[i] = 0;
                }
            }
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)