Raised This Month: $51 Target: $400
 12% 

Log all commands


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose       
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 02-06-2012 , 12:12   Log all commands
Reply With Quote #1

Description:
Log all commands of the player.

Example of Log:
Local: addons/amxmodx/logs
Name of log: playername_commands.log

Cvars:
amx_log_all_commands - Enable/Disable (Def.: 1)

Changelog:
Version: 1.0 - Initial public release.

Credits:
Exolent[jNr]

To do:
Any ideia?

Thanks.
Attached Files
File Type: sma Get Plugin or Get Source (log_all_commands.sma - 941 views - 525 Bytes)
__________________

Last edited by kramesa; 02-06-2012 at 12:15.
kramesa is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-06-2012 , 13:01   Re: Log all commands
Reply With Quote #2

Already exists.

http://forums.alliedmods.net/showthread.php?p=132210
http://forums.alliedmods.net/showthread.php?t=7204

Again, please search before posting.

Unapproved.
__________________
Arkshine is offline
RoaR
Member
Join Date: Dec 2011
Old 02-06-2012 , 13:05   Re: Log all commands
Reply With Quote #3

Maybe adding a console print that says "Your command has been logged."?

Nice plugin though, i would make a shorter cvar.

I would also add time when the command was used and the steam ID of player that used command because anytime the user can change his name.

So i would like to see your plugin like this:
PHP Code:
#include <amxmodx>

new pCvar_Enable;

public 
plugin_init()
{
    
register_plugin("Log all commands file""1.0""kramesa");
    
    
pCvar_Enable register_cvar("amx_log_all_commands""1");
}

public 
client_command(id
{
    if(
get_pcvar_num(pCvar_Enable))
    {
        new 
Command[32];
        
read_argv(0Commandcharsmax(Command));
        
        new 
szName[32];
        
get_user_name(idszName31);
        new 
authid[32];
        
        
get_user_authid(id,authid,31);
        
        new 
Log_Name[512];
        
formatex(Log_Name511"%s_commands.log"szName);
        
        new 
thetime[9];
        
get_time("H%:%M:%S",thetime,8);
        
        
log_to_file(Log_Name"[%s] UserID: %s, Nick: %s has used %s command!",thetime,authid,szName,Command);
        
console_print(id,"You have used %s command and we have logged that.",Command);
    }

I didn't change the cvar. ;)
RoaR is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-06-2012 , 13:30   Re: Log all commands
Reply With Quote #4

Quote:
Originally Posted by RoaR View Post
Maybe adding a console print that says "Your command has been logged."?
You would have your console spammed so much.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 02-06-2012 , 17:23   Re: Log all commands
Reply With Quote #5

Quote:
Originally Posted by RoaR View Post
Maybe adding a console print that says "Your command has been logged."?

Nice plugin though, i would make a shorter cvar.

I would also add time when the command was used and the steam ID of player that used command because anytime the user can change his name.

So i would like to see your plugin like this:
PHP Code:
#include <amxmodx>

new pCvar_Enable;

public 
plugin_init()
{
    
register_plugin("Log all commands file""1.0""kramesa");
    
    
pCvar_Enable register_cvar("amx_log_all_commands""1");
}

public 
client_command(id
{
    if(
get_pcvar_num(pCvar_Enable))
    {
        new 
Command[32];
        
read_argv(0Commandcharsmax(Command));
        
        new 
szName[32];
        
get_user_name(idszName31);
        new 
authid[32];
        
        
get_user_authid(id,authid,31);
        
        new 
Log_Name[512];
        
formatex(Log_Name511"%s_commands.log"szName);
        
        new 
thetime[9];
        
get_time("H%:%M:%S",thetime,8);
        
        
log_to_file(Log_Name"[%s] UserID: %s, Nick: %s has used %s command!",thetime,authid,szName,Command);
        
console_print(id,"You have used %s command and we have logged that.",Command);
    }

I didn't change the cvar. ;)
Yeah, i will optmize this plugin.
__________________
kramesa 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 03:11.


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