Raised This Month: $ Target: $400
 0% 

Catching admin actions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Warlord_dd2
Junior Member
Join Date: Oct 2013
Old 10-13-2013 , 12:05   Catching admin actions
Reply With Quote #1

Hello,

I would like to know what is the best way (most optimal / resource saving) to catch admin action and do something with it.

For example:
1 / To log normal chat and team chat made by admins on one place
I need this to put normal chat of my admins in amx_logs, thus on one place have everything admin related that I might need.

2 / To "catch" many commands like "amx_ban", "amx_kick", "amx_slap", amx_slay", etc.
The reason for this is that I want to print console message to headadmins of who did what action, so we can better know who exactly issued which punishmetn, etc. Yes, I can go to amx_logs and see that, but purpose of this is to save time and also to give same ability to some people that I don't wanna give FTP access yet.

Thank you in advanced
Warlord_dd2 is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 10-13-2013 , 14:32   Re: Catching admin actions
Reply With Quote #2

First:
Create an array that handler with all console commands
Then loop though all plugins, then get all console commands, and store them in the array if they are an admin commands.

Then hook client_command forward, get the args of the command (read_args) (read_argv(0,command,charsmax(command)) = The command itself)

Loop the array and check if the command match to any command in the array.

If there is a match just what you have to do is to log the admin name && steamid && ip && userid && command && command args and of course break the loop.
__________________

Last edited by simanovich; 10-13-2013 at 14:32.
simanovich is offline
LordOfNothing
BANNED
Join Date: Jul 2013
Old 10-16-2013 , 03:57   Re: Catching admin actions
Reply With Quote #3

and is_user_admin no necesary ?
LordOfNothing is offline
Warlord_dd2
Junior Member
Join Date: Oct 2013
Old 10-17-2013 , 06:01   Re: Catching admin actions
Reply With Quote #4

@ LordOfNothing,

It is necessary, since I wanted to reduce spam in amx logs, and I only need that, so when I search logs for activity of an admin, I can see his attitude towards users as well as amx commands that he has used.

@ Topic,
Anyway, I have handled both problems by calling all necessary actions with "register_clcmd", from where I have done all the filtering that I needed.
example:
register_clcmd("say", "get_text")
register_clcmd("amx_ban", "do_leadersee")
register_clcmd("amx_unban", "do_leadersee")
register_clcmd("amx_kick", "do_leadersee")
register_clcmd("amx_gag", "do_leadersee")
etc...

It is probably not very resource saving, but it does its purpose, and as far as it appears till now, its not slowing down the server either.

OFC, any approach that would be more resource saving would be appreciated

Last edited by Warlord_dd2; 10-17-2013 at 06:02.
Warlord_dd2 is offline
Reply



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 20:00.


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