14.07.2013, 17:19
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.
CODE
Thanks
PS. Sorry for my bad English.
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:
#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; } } }
PS. Sorry for my bad English.