AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   removing immunity (https://forums.alliedmods.net/showthread.php?t=105641)

FIYA 10-06-2009 17:25

removing immunity
 
hi,
i was wondering how can i get rid of the immunity check so the plugin applies to all the players despite the flags. it's probably a simple thing to do but i'm not that into scripting so please help me :)

Code:

/* AMX Mod script
*
* (c) 2002-2003
* This file is provided as is (no warranties).
*
* Players with immunity/slot reservation won't be checked
*/

#include <amxmodx>

new HIGHPING_MAX = 100 // set maximal acceptable ping
new HIGHPING_TIME = 6  // set in seconds frequency of ping checking
new HIGHPING_TESTS = 5  // minimal number of checks before doing anything

new iNumTests[33]

public plugin_init() {
    register_plugin("High Ping Kicker","1.0","OLO")
    if (HIGHPING_TIME < 15) HIGHPING_TIME = 15
    if (HIGHPING_TESTS < 4) HIGHPING_TESTS = 4
    return PLUGIN_CONTINUE
}

public client_disconnect(id) {
    remove_task(id)
    return PLUGIN_CONTINUE
}
   
public client_putinserver(id) {
    iNumTests[id] = 0
    if (!is_user_bot(id)) {
        new param[1]
        param[0] = id
        set_task(30.0, "showWarn", id, param, 1)
    }
    return PLUGIN_CONTINUE
}

kickPlayer(id) {
    new name[32]
    get_user_name(id, name, 31)
    new uID = get_user_userid(id)
    server_cmd("kick #%d ^"Your ping is too high, come back later...^"", uID)
    client_print(0, print_chat, "** %s is kicked because of high ping!", name)
    return PLUGIN_CONTINUE
}

public checkPing(param[]) {
    new id = param[0]
    if ((get_user_flags(id) & ADMIN_IMMUNITY) || (get_user_flags(id) & ADMIN_RESERVATION)) {
        remove_task(id)
        return PLUGIN_CONTINUE
    }
    new p, l
    get_user_ping(id, p, l)
    if (p > HIGHPING_MAX)
        ++iNumTests[id]
    else
        if (iNumTests[id] > 0) --iNumTests[id]
    if (iNumTests[id] > HIGHPING_TESTS)
        kickPlayer(id)
    return PLUGIN_CONTINUE
}

public showWarn(param[]) {
    set_task(float(HIGHPING_TIME), "checkPing", param[0], param, 1, "b")
    return PLUGIN_CONTINUE
}


Arkshine 10-06-2009 17:31

Re: removing immunity
 
It's quite an old plugin you use. You should take a look at another more recent.

Remove :

Code:
if ((get_user_flags(id) & ADMIN_IMMUNITY) || (get_user_flags(id) & ADMIN_RESERVATION)) {         remove_task(id)         return PLUGIN_CONTINUE     }

FIYA 10-06-2009 17:41

Re: removing immunity
 
actually i like it, it's simple and does what i want it to do without all this unnessecary shit ;)

Arkshine 10-06-2009 17:45

Re: removing immunity
 
Not a problem.


All times are GMT -4. The time now is 22:38.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.