Forum
Ping Kicker - Printable Version

+- Forum (https://dm20.net/forum)
+-- Forum: Scripting (https://dm20.net/forum/forumdisplay.php?fid=5)
+--- Forum: Showcase (https://dm20.net/forum/forumdisplay.php?fid=6)
+--- Thread: Ping Kicker (/showthread.php?tid=6)



Ping Kicker - marcudaniel1337 - 07-28-2024

This is a simple plugin kicking everyone from the server with ping above 350. You can change that value to whatever you like.

Code:
#include <amxmodx>
#include <engine>

public plugin_init()
{
    register_plugin("Ping", "1.0", "sToP !")
    set_task(60.0, "check_ping", _, _, _, "b")
}

public check_ping()
{
    for(new id = 1; id <= get_playersnum(); id++)
    {
        new ping, loss
        get_user_ping(id,ping, loss)
        if( ping > 350)
        {
            client_print(id, print_console, "[HL.DM20.NET] You were kicked because you have ping over 350!")
            client_cmd(id, "disconnect")
        }
    }
    return PLUGIN_CONTINUE
}