View Single Post
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 10-12-2018 , 11:51   Re: Plugin Request [Admin Command Logs]
Reply With Quote #9

Quote:
Originally Posted by D4rkSiD3Rs View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>

new g_cmdLine1[512], g_cmdLine2[512], g_cmdLine3[512], g_cmdLine4[512]

new const 
g_UsualCommands[][] =  
{
    
"menuselect",
    
"weapon_",
    
"VModEnable",
    
"jointeam",
    
"kill",
    
"joinclass",
    
"chooseteam",
    
"jointeam",
    
"vban",
    
"lastinv",
    
"specmode",
    
"say",
    
"say_team",
    
"changeview",
    
"drop",
    
"nightvision",
    
"paint",
    
"radio",
    
"VTC_CheckStart",
    
"VTC_CheckEnd"
}

public 
plugin_init()
{
    
register_plugin("Admin Commands Logger""1.0""TheWhitesmith"// Edited by D4rkSiD3Rs
}

public 
client_command(id)
{
    if(!(
get_user_flags(id) & ADMIN_KICK) && !(get_user_flags(id) & ADMIN_BAN))
        return 
PLUGIN_CONTINUE

    
new name[32]
    new 
authid[32]
    new 
logfile[50]
    new 
configsdir[200]

    new 
text[charsmax(name)+(4*charsmax(g_cmdLine1))]
    
get_configsdir(configsdircharsmax(configsdir))
    
formatex(logfilecharsmax(logfile), "%s/admin_commands_log.txt"configsdir)
    
get_user_name(idnamecharsmax(name))
    
get_user_authid(idauthidcharsmax(authid))

    
read_argv(0g_cmdLine1511)
    
read_argv(1g_cmdLine2511)
    
read_argv(2g_cmdLine3511)
    
read_argv(3g_cmdLine4511)

    for (new 
0sizeof(g_UsualCommands); i++)
    {
        if(
containi(g_cmdLine1g_UsualCommands[i]) != -1)
        {
            return 
PLUGIN_CONTINUE
        
}
    }
    
    static 
datestr[11]
    
get_time("%Y-%m-%d"datestr10)
    new 
timestr[9]
    
get_time("%H:%M:%S"timestr8)

    
formatex(textcharsmax(text), "L %s - %s: Name: %s | SteamID: %s | Command: %s %s %s %s"datestrtimestrnameauthidg_cmdLine1g_cmdLine2g_cmdLine3g_cmdLine4)
    
write_file(logfiletext)
    
    return 
PLUGIN_CONTINUE

Instead of ignoring list? Can't we make a list? Which should be traced?

As it still trace some commands which are irrelevant like:

awp
famas
follow A

Even I have ignored many of self too but still.

Quote:
Originally Posted by Trace Commands?
amx_who
amx_map
amx_vote
amx_votemap
amx_votekick
amx_voteban
amx_cancelvote
amx_cvar
amx_nick
amx_rcon
amx_gag
amx_ungag
amx_addgag
amx_setlang
amx_addrounds
amx_fakeping
amx_exec
amx_mexec
amx_teleportmenu
amx_restrict
amx_restmenu
amx_statscfg
amx_statscfgmenu
amx_addadmin
amx_pause
cm_set_prefix
amx_plugincvarmenu
amx_advertisebet
amx_on
amx_off
amx_cvarmenu
amx_pausecfg
amx_pausecfgmenu
amx_cmdmenu
amx_clcmdmenu
amx_cfgmenu
amx_speechmenu
amx_teammenu
amx_perm_msg
amxmodmenu
mk47killer
rcon
Or Just?
Quote:
amx_
amxmodmenu
rcon

Last edited by Alber9091; 10-12-2018 at 12:48.
Alber9091 is offline