How to check for nitro -
MWF2 - 24.06.2010
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?
Re: How to check for nitro -
Kar - 24.06.2010
maybe getplayercomponenttyle?
Re: How to check for nitro -
MadeMan - 24.06.2010
https://sampwiki.blast.hk/wiki/GetVehicleComponentInSlot
Re: How to check for nitro -
YnYectoRx.79 - 24.06.2010
Use this
Код:
GetVehicleComponentType(1010);
I think ...
Re: How to check for nitro -
MWF2 - 24.06.2010
Wow quick replys lol, thanks guys.
How can i check which car has which component
Re: How to check for nitro -
Kar - 24.06.2010
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.
Re: How to check for nitro -
MadeMan - 24.06.2010
pawn Код:
if(GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_NITRO) != 0) // this car has nitro
{
}
Re: How to check for nitro -
MWF2 - 24.06.2010
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);
}
}
}
}
}
}
}
Re: How to check for nitro -
MadeMan - 24.06.2010
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);
}
}
}
}
Re: How to check for nitro -
Evgeni_Degerev - 24.06.2010
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);
}
}