Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define MAX_PING 500
- forward CheckPing();
- new
- pingtimer;
- public OnGameModeInit()
- {
- pingtimer = SetTimer("CheckPing", 2000, 1);
- return 1;
- }
- public OnGameModeExit()
- {
- KillTimer(pingtimer);
- }
- public CheckPing()
- {
- for (new i; i < MAX_PLAYERS; ++i)
- {
- if (IsPlayerConnected(i) && GetPlayerPing(i) > MAX_PING && GetPlayerState(i) != PLAYER_STATE_NONE)
- {
- SendClientMessage(i, 0xFF000000, "You have been kicked for exceeding the ping limit of "#MAX_PING"");
- Kick(i);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment