[FilterScript] Anti High-Pings - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Anti High-Pings (
/showthread.php?tid=450778)
Anti High-Pings -
WorldWideGaming - 14.07.2013
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.
Re: Anti High-Pings -
ScRipTeRi - 14.07.2013
Not Bad
AW: Anti High-Pings -
[AK]Nazgul - 14.07.2013
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.
Re: Anti High-Pings -
DangerousXxX - 15.07.2013
Wery nice God work dude =]