These codes are what make the trolls cars invulnerable

E

elianfox

Guest
#1
ANTITROLL CODE  ANTICHEAT  HELP !!!



[font=arial, sans-serif]it's from a modified game mode[/font]

[font=arial, sans-serif]''pawnscript'''[/font]


Code:
/*
Anti troll de veículos
18/03/2017 - Jelly23
*/

#if !defined FILTERSCRIPT

/*Uso de foreach*/
#define ATV_USAR_FOREACH (true)

/*Variavel e callbacks*/
static 
ATV_Timer;

forward ATV_TrollCheck();
forward OnPlayerTroll(playerid);

public OnGameModeInit()
{
	ATV_Timer = SetTimer("ATV_TrollCheck", 1000, true);
	#if defined JT_OnGameModeInit
	return JT_OnGameModeInit();
	#else
	return 1;
	#endif
}

public OnGameModeExit()
{
	KillTimer(ATV_Timer);
	#if defined JT_OnGameModeExit
	return JT_OnGameModeExit();
	#else
	return 1;
	#endif
}

public ATV_TrollCheck()
{
	#if ATV_USAR_FOREACH true
	foreach(new i: Player)
	{
		if(IsPlayerInAnyVehicle(i))
		{
			if(GetPlayerVehicleID(i) != GetPVarInt(i, "ATV_Carro"))
			{
				if(gettime() > GetPVarInt(i, "ATV_Tempo"))
				{
					OnPlayerTroll(i);
				}
			}
		}
	}
	#else
	for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(IsPlayerInAnyVehicle(i))
			{
				if(GetPlayerVehicleID(i) != GetPVarInt(i, "ATV_Carro"))
				{
					if(gettime() > GetPVarInt(i, "ATV_Tempo"))
					{
						OnPlayerTroll(i);
					}
				}
			}
		}
	}
	#endif
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate == PLAYER_STATE_DRIVER)
	{
		if(GetPVarInt(playerid, "ATV_RJack") == 1)
		{
			OnPlayerTroll(playerid);
		}
		if(oldstate == PLAYER_STATE_PASSENGER)
		{
			OnPlayerTroll(playerid);
		}
	}

	#if defined JT_OnPlayerStateChange
	return JT_OnPlayerStateChange(playerid, newstate, oldstate);
	#else
	return 1;
	#endif
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	SetPVarInt(playerid, "ATV_Carro", vehicleid);
	if(!ispassenger)
	{
		SetPVarInt(playerid, "ATV_RJack", 1);
	}
	#if defined JT_OnPlayerEnterVehicle
	return JT_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
	#else
	return 1;
	#endif
}

public OnPlayerConnect(playerid)
{
	SetPVarInt(playerid, "ATV_RJack", 0);
	SetPVarInt(playerid, "ATV_Carro", 0);
	#if defined JT_OnPlayerConnect
	return JT_OnPlayerConnect(playerid);
	#else
	return 1;
	#endif
}

public OnPlayerUpdate(playerid)
{
	if(GetPVarInt(playerid, "ATV_RJack") == 1 && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_ENTER_VEHICLE)
	{
		SetPVarInt(playerid, "ATV_RJack", 0);
		SetPVarInt(playerid, "ATV_Tempo", gettime()+3);
	}
	#if defined JT_OnPlayerUpdate
	return JT_OnPlayerUpdate(playerid);
	#else
	return 1;
	#endif
}

public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
{
    if(floatround(floatsqroot(vel_x * vel_x + vel_y * vel_y) * 200, floatround_round) > 1100)
	{
		OnPlayerTroll(playerid);
		return 0;
	}
	if(GetVehicleDistanceFromPoint(vehicleid, new_x, new_y, new_z) > 15)
	{
		return 0;
	}
	#if defined JT_OnUnoccupiedVehicleUpdate
	return JT_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z);
	#else
	return 1;
	#endif
}

#if defined _ALS_OnPlayerStateChange
#undef OnPlayerStateChange
#else
#define _ALS_OnPlayerStateChange
#endif
#define OnPlayerStateChange     JT_OnPlayerStateChange

#if defined JT_OnPlayerStateChange
forward JT_OnPlayerStateChange(playerid, newstate, oldstate);
#endif

#if defined _ALS_OnPlayerEnterVehicle
#undef OnPlayerEnterVehicle
#else
#define _ALS_OnPlayerEnterVehicle
#endif
#define OnPlayerEnterVehicle     JT_OnPlayerEnterVehicle

#if defined JT_OnPlayerEnterVehicle
forward JT_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
#endif

#if defined _ALS_OnPlayerConnect
#undef OnPlayerConnect
#else
#define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect     JT_OnPlayerConnect

#if defined JT_OnPlayerConnect
forward JT_OnPlayerConnect(playerid);
#endif

#if defined _ALS_OnPlayerUpdate
#undef OnPlayerUpdate
#else
#define _ALS_OnPlayerUpdate
#endif
#define OnPlayerUpdate     JT_OnPlayerUpdate

#if defined JT_OnPlayerUpdate
forward JT_OnPlayerUpdate(playerid);
#endif

#if defined _ALS_OnUnoccupiedVehicleUpdate
#undef OnUnoccupiedVehicleUpdate
#else
#define _ALS_OnUnoccupiedVehicleUpdate
#endif
#define OnUnoccupiedVehicleUpdate     JT_OnUnoccupiedVehicleUpdate

#if defined JT_OnUnoccupiedVehicleUpdate
forward JT_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z);
#endif

#if defined _ALS_OnGameModeInit
#undef OnGameModeInit
#else
#define _ALS_OnGameModeInit
#endif
#define OnGameModeInit     JT_OnGameModeInit

#if defined JT_OnGameModeInit
forward JT_OnGameModeInit();
#endif

#if defined _ALS_OnGameModeExit
#undef OnGameModeExit
#else
#define _ALS_OnGameModeExit
#endif
#define OnGameModeExit     JT_OnGameModeExit

#if defined JT_OnGameModeExit
forward JT_OnGameModeExit();
#endif

#endif

stock JT_PutPlayerInVehicle(playerid, vehicleid, seatid)
{
	SetPVarInt(playerid, "ATV_Tempo", gettime()+3);
	SetPVarInt(playerid, "ATV_Carro", vehicleid);
	SetPVarInt(playerid, "ATV_RJack", 0);
	return PutPlayerInVehicle(playerid, vehicleid, seatid);
}

stock JT_RemovePlayerFromVehicle(playerid)
{
	SetPVarInt(playerid, "ATV_Tempo", gettime()+3);
	SetPVarInt(playerid, "ATV_Carro", 0);
	SetPVarInt(playerid, "ATV_RJack", 0);
	return RemovePlayerFromVehicle(playerid);
}

#if defined _ALS_RemovePlayerFromVehicle
#undef RemovePlayerFromVehicle
#else
#define _ALS_RemovePlayerFromVehicle
#endif

#define RemovePlayerFromVehicle JT_RemovePlayerFromVehicle

#if defined _ALS_PutPlayerInVehicle
#undef PutPlayerInVehicle
#else 
#define _ALS_PutPlayerInVehicle
#endif

#define PutPlayerInVehicle JT_PutPlayerInVehicle
 

WaTTi

Well-Known Member
Joined
Jan 4, 2015
Messages
261
Likes
7
Points
93
Website
ww
#2
hola, elianfox veo que estás aprendiendo, deja fenixzone.

Es relativamente sencillo hacer bypass al anticheat, únicamente detecta si ingresas al vehículo por medio de la animación y envías los paquetes de que lo haces, puedes utilizar los siguientes opcodes para falsificar esa información, además de que si tienes un cheat lo suficientemente rápido para joder antes de 1 segundo entonces te daría suficiente tiempo para hacer lo que sea antes de ser expulsado.
0B30: samp send_enter_vehicle 1@ as_passenger 2@
 
OP
OP
E

elianfox

Guest
#3
Good friend, what happens, esque. I have not found the form and there are no specific traps for that, since in many servers it has that anticheat.

 
Top