[FilterScript] Anti High-Pings
#1

Hi Guys,
Its my first FS so please don't post bad comments.

ABOUT
This FS work like that when player exceed max ping he kicked and also send message to that player but admin can enable and disable max pings ig and you also can change max pings from FS.
PHP Code:
#define MAXPINGS 400 
CODE
Code:
#include <a_samp>
#include <zcmd>

//=========================MAX PINGS===============================DEFINE//
#define MAXPINGS 1000    //Change this value to change the ping amount in which player will kick

#define enable 0
#define disable 1

new ping[MAX_PLAYERS];






//======================WHEN FS ON==========================//
public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	
	
	print("Anti High Ping BY WorldWideGaming [LOADED]");
	
	
	print("--------------------------------------\n");
	
	
	return 1;
}



//====================WHEN FS EXIT==================//
public OnFilterScriptExit()
{
	print("\n--------------------------------------");
	
	
	print("Anti High Ping BY WorldWideGaming [ULOADED]");
	
	
	print("--------------------------------------\n");
	
	
	return 1;
}




//=============WHEN PLAYER WILL UPDATE=============//
public OnPlayerUpdate(playerid)
{

	//=====WHEN PLAYER PINGS WILL MOST AGAINST MAX PINGS=====//
	
	if(ping[playerid] != disable)
	{
	
		if(GetPlayerPing(playerid) > MAXPINGS)
		{
			new string[256];
		
		
		
			new pName[MAX_PLAYER_NAME];
		
		
		
			GetPlayerName(playerid, pName, sizeof(pName));
		
		
			format(string, sizeof(string),"High-Ping:Kicked %s (ID%d) for high pings",pName, playerid);
		
		
		
			SendClientMessageToAll(0x7B95B3FF, string);

		
		
			GameTextForPlayer(playerid,"~r~KICKED FOR HIGH PINGS~r~",3000,4);
		
		
		
			SetTimerEx("pKick", 3000, true, "i", playerid);
		
		
		
		}
		
		
		
	}
	
	
	
	return 1;
	
	
	
}



forward pKick(playerid);



public pKick(playerid)
{
	
		Kick(playerid);
	
}

CMD:disablemaxpings(playerid, params[])
{


 	if(IsPlayerAdmin(playerid))
 	{
 	
		for(new i; i < MAX_PLAYERS; i++)
		{
		
		    ping[i] = disable;
		    
		}
		
		
	}
	
	
}

CMD:enablemaxpings(playerid, params[])
{


 	if(IsPlayerAdmin(playerid))
 	{
		for(new i; i<MAX_PLAYERS; i++)
		{
		
		    ping[i] = enable;
		    
		}
		
		
	}
	
	
}
Thanks

PS. Sorry for my bad English.
Reply
#2

Not Bad
Reply
#3

You should consider that this way, the Kick-Message will spam the chat for 3 whole seconds, around 64 times a second. You should probably add some secruity block that prevents the same action from being called again once it has been called.
Reply
#4

Wery nice God work dude =]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)