Noticias:

No tienes permiso para ver los enlaces. Para poder verlos Registrate o Conectate.

Menú Principal

Anty - Bunny

Iniciado por Swarlog, May 13, 2025, 06:40 PM

Tema anterior - Siguiente tema

Swarlog


Código:

#include <a_samp>

#define FILTERSCRIPT

#undef 	MAX_PLAYERS
#define MAX_PLAYERS 	(120)

new Saltando[MAX_PLAYERS];
new CSalto[MAX_PLAYERS];

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Sistema AntiBH by Clicked cargado.");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
    print("\n--------------------------------------");
	print(" Sistema AntiBH by Clicked descargado...");
	print("--------------------------------------\n");
	return 1;
}

#endif

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(IsKeyJustDown(KEY_JUMP,newkeys,oldkeys))
	{
	 	if(!IsPlayerInAnyVehicle(playerid))
	 	{
		 	if(CSalto[playerid] == 0)
		 	{
			 	CSalto[playerid] = 1;
			 	Saltando[playerid] = 1;
			 	SetTimerEx("QuitarSaltando", 5000, 0, "d", playerid);
			}
			else if(CSalto[playerid] == 1)
		 	{
			 	CSalto[playerid] = 2;
			}
			else if(CSalto[playerid] == 2)
		 	{
			 	CSalto[playerid] = 3;
			 	SetTimerEx("QuitarSaltando", 5000, 0, "d", playerid);
			}
		 	else if(CSalto[playerid] == 3)
		 	{
			 	CSalto[playerid] = 4;
			 	SetTimerEx("DescongelarBH", 15000, 0, "d", playerid);
			 	SendClientMessage(playerid, -1, "Has sido congelado por 15 segundos por hacer Bunny Hop");
			 	TogglePlayerControllable(playerid,0);
			}
		}
	}
	return 1;
}

IsKeyJustDown(key, newkeys, oldkeys)
{
	if((newkeys & key) && !(oldkeys & key)) return 1;
	return 0;
}

forward QuitarSaltando(playerid);
public QuitarSaltando(playerid)
{
	Saltando[playerid] = 0;
	CSalto[playerid] = 0;
	return 1;
}

forward DescongelarBH(playerid);
public DescongelarBH(playerid)
{
	Saltando[playerid] = 0;
	CSalto[playerid] = 0;
	TogglePlayerControllable(playerid,1);
	SendClientMessage(playerid, -1, "Has sido descongelado no vuelvas a hacer BH.");
	return 1;
}