Raised This Month: $ Target: $400
 0% 

Exceptions for admins with rcon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tRipLe.
Senior Member
Join Date: Dec 2009
Location: Estonia, Pärnu
Old 12-28-2010 , 22:37   Exceptions for admins with rcon
Reply With Quote #1

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.
__________________
τsэ - servers.ee:9987
tRipLe. is offline
Send a message via MSN to tRipLe. Send a message via Skype™ to tRipLe.
Elusive138
Senior Member
Join Date: Dec 2010
Old 12-28-2010 , 22:44   Re: Exceptions for admins with rcon
Reply With Quote #2

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.
Elusive138 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-29-2010 , 00:18   Re: Exceptions for admins with rcon
Reply With Quote #3

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.
__________________
fysiks is offline
Elusive138
Senior Member
Join Date: Dec 2010
Old 12-29-2010 , 00:58   Re: Exceptions for admins with rcon
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
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.

Last edited by Elusive138; 12-29-2010 at 01:01.
Elusive138 is offline
tRipLe.
Senior Member
Join Date: Dec 2009
Location: Estonia, Pärnu
Old 12-29-2010 , 17:38   Re: Exceptions for admins with rcon
Reply With Quote #5

Thanks ;).
__________________
τsэ - servers.ee:9987
tRipLe. is offline
Send a message via MSN to tRipLe. Send a message via Skype™ to tRipLe.
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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