How to check for nitro
#1

Does anyone know how i can make a ban if a player adds nitro to certain vehicles?


Sometimes hackers add nitro/etc to certain vehicles like the police water truck and drive around with it.


How can i detect that and ban the player for it and destroy the vehicle on it's own?
Reply
#2

maybe getplayercomponenttyle?
Reply
#3

https://sampwiki.blast.hk/wiki/GetVehicleComponentInSlot
Reply
#4

Use this

Код:
 GetVehicleComponentType(1010);
I think ...
Reply
#5

Wow quick replys lol, thanks guys.


How can i check which car has which component
Reply
#6

define the car name in ongame mode int

or just use what they said above

maybe this?
Код:
  {
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFF0000AA,"You are not in a vehicle!"); // If the player is not in vehicle...
    if(GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),GetVehicleComponentType(1010)) != 1010) // Check if the vehicle has no nitro
    ban(playerid);
    return 1;
  }
or something like that.


Reply
#7

pawn Код:
if(GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_NITRO) != 0) // this car has nitro
{

}
Reply
#8

This is what I did. It doesn't work


pawn Код:
forward CarComponentAnti();
pawn Код:
SetTimer("CarComponentAnti",1500,1);

pawn Код:
public CarComponentAnti()
{
  for (new i = 0; i < MAX_PLAYERS; i++)
    {
     if(IsPlayerConnected(i) && IsSpawned[i] == 1)
      {
    new vehicleid = GetPlayerVehicleID(i);
    if(GetVehicleModel(vehicleid) == 601 || GetVehicleModel(vehicleid) == 522 || GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 521 || GetVehicleModel(vehicleid) == 422) {
    {
    if(GetVehicleComponentInSlot(GetPlayerVehicleID(i), CARMODTYPE_NITRO) != 0) // this car has nitro
    {
      if(PlayerAdminLevel[i] != 1337) {
     new string[256];
     GetPlayerName(i, pname, 30);
     format(string, sizeof(string), "**(AUTO BAN)** %s(%d) Our Anti-Cheat has detected a hax0r",pname,i);
     SendClientMessageToAll(0xFF7F50AA, string);
     SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN DETECTED AS A CHEATER/HACKER");
     SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN BANNED FROM THIS SERVER");
     SendClientMessage(i,COLOR_RED,"If you think this is a mistake. Visit to appeal this ban");
     format(string, sizeof(string), "**(AUTO BAN)** %s(%d) Our Anti-Cheat has detected a hax0r (Nitro Hacker)",pname,i);
     printf("%s", string);
     if(udb_Exists(PlayerName(i)) && PLAYERLIST_authed[i]) {
         dUserSetINT(PlayerName(i)).("nameban",1);
     }
     SetPlayerInterior(i,10);
     SetPlayerPos(i,219.6257,111.2549,999.0156);
     SetPlayerFacingAngle(i,2.2339);
     SetCameraBehindPlayer(i);
     Banning[i] = 1;
     SetTimer("BanPlayer",700,0);

    }
    }
 }
}
}
}
}
Reply
#9

Try this

pawn Код:
public CarComponentAnti()
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new vehicleid = GetPlayerVehicleID(i);
            if(GetVehicleComponentInSlot(vehicleid, CARMODTYPE_NITRO) != 0)
            {
                new string[256];
                GetPlayerName(i, pname, 30);
                format(string, sizeof(string), "**(AUTO BAN)** %s(%d) Our Anti-Cheat has detected a hax0r",pname,i);
                SendClientMessageToAll(0xFF7F50AA, string);
                SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN DETECTED AS A CHEATER/HACKER");
                SendClientMessage(i,COLOR_RED,"YOU HAVE BEEN BANNED FROM THIS SERVER");
                SendClientMessage(i,COLOR_RED,"If you think this is a mistake. Visit to appeal this ban");
                format(string, sizeof(string), "**(AUTO BAN)** %s(%d) Our Anti-Cheat has detected a hax0r (Nitro Hacker)",pname,i);
                printf("%s", string);
                if(udb_Exists(PlayerName(i)) && PLAYERLIST_authed[i])
                {
                    dUserSetINT(PlayerName(i)).("nameban",1);
                }
                SetPlayerInterior(i,10);
                SetPlayerPos(i,219.6257,111.2549,999.0156);
                SetPlayerFacingAngle(i,2.2339);
                SetCameraBehindPlayer(i);
                Banning[i] = 1;
                SetTimer("BanPlayer",700,0);
            }
        }
    }
}
Reply
#10

or this
Код:
public OnVehicleMod(playerid,vehicleid,componentid)
{
	#pragma unused playerid
	if(componentid>=1008&&componentid<=1010)
	{
	  RemoveVehicleComponent(vehicleid,componentid);
	}
}
or this...
Код:
public OnVehicleMod(playerid,vehicleid,componentid)
{
	if(componentid>=1008&&componentid<=1010)
	{
	  BanEx(playerid,Nitro Hacker);
	  RemoveVehicleComponent(vehicleid,componentid);
	}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)