AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Exceptions for admins with rcon (https://forums.alliedmods.net/showthread.php?t=146529)

tRipLe. 12-28-2010 22:37

Exceptions for admins with rcon
 
How to make functions so immunity on target will not work if admin with rcon issues the command on him/her?

For example - banning. Immunity admins can't be banned by other admins, but i'd want admins with rcon (l access flag) ban even if target has immunity.

Elusive138 12-28-2010 22:44

Re: Exceptions for admins with rcon
 
Well, wherever it checks for immunity, e.g.
PHP Code:

if (access(targetidADMIN_IMMUNITY))
    return 
PLUGIN_HANDLED 

you can change it to
PHP Code:

if (access(targetidADMIN_IMMUNITY) && !access(adminidADMIN_RCON)) 

so it will only quit or print a "target is immune" message if the admin who uses the command does not have the ADMIN_RCON flag.

fysiks 12-29-2010 00:18

Re: Exceptions for admins with rcon
 
Actually, I would recommend modifying cmd_target() in amx_misc.inc to ignore immunity if admin has rcon flag. Then all you have to do is recompile all your plugins (which is easy) and voila.

I am quite positive that I've done this before somewhere.

Elusive138 12-29-2010 00:58

Re: Exceptions for admins with rcon
 
Quote:

Originally Posted by fysiks (Post 1381430)
Actually, I would recommend modifying cmd_target() in amx_misc.inc to ignore immunity if admin has rcon flag. Then all you have to do is recompile all your plugins (which is easy) and voila.

I am quite positive that I've done this before somewhere.

In that case, it would be
PHP Code:

        if ((get_user_flags(player) & ADMIN_IMMUNITY) && 
            ((
flags CMDTARGET_ALLOW_SELF) ? (id != player) : true) ) 

=>
PHP Code:

        if ((get_user_flags(player) & ADMIN_IMMUNITY) && 
            ((
flags CMDTARGET_ALLOW_SELF) ? (id != player) : true)  &&
             !(
get_user_flags(id) & ADMIN_RCON) ) 

in amxmisc.inc

But that would only work if you compile plugins yourself, not if you want to release the sma/use the webcompiler. Also, only if you were using cmd_target and not some other way of checking admin flags.

tRipLe. 12-29-2010 17:38

Re: Exceptions for admins with rcon
 
Thanks ;).


All times are GMT -4. The time now is 02:04.

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