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

Plugin Request [Admin Command Logs]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 09-24-2018 , 12:51   Plugin Request [Admin Command Logs]
Reply With Quote #1

I know there are many plugins but some are quite complicated and some don't lie on request, so,

Can anyone make, a small Plugin

#Define Flag: C (Kick) And D (Ban)

Record Command Logs:

Saved in configs/AdminCmdLogs.txt

Time, Admin Nick, Admin Steam Id, Command Executed !!!!

May be if the plugin, trace?

amx_ (logs)

Last edited by Alber9091; 10-13-2018 at 11:06.
Alber9091 is offline
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 10-10-2018 , 15:09   Re: Plugin Request [Admin Command Logs]
Reply With Quote #2

Bump !!! (After 17 Days)
Anyone Here Please? Who can help?

Last edited by Alber9091; 10-11-2018 at 03:07.
Alber9091 is offline
shehzad1234
BANNED
Join Date: Jan 2016
Location: https://t.me/pump_upp
Old 10-10-2018 , 15:24   Re: Plugin Request [Admin Command Logs]
Reply With Quote #3

bump
shehzad1234 is offline
Send a message via ICQ to shehzad1234 Send a message via AIM to shehzad1234 Send a message via Yahoo to shehzad1234
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 10-11-2018 , 15:26   Re: Plugin Request [Admin Command Logs]
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <amxmisc>

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

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[20];

    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)
    
    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

__________________


D4rkSiD3Rs is offline
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 10-11-2018 , 16:58   Re: Plugin Request [Admin Command Logs]
Reply With Quote #5

Quote:
L 10/11/2018 - 213:20: Couldn't write file "cstrike/addons/amxmodx/conf/admin_commands_log.txt"
L 10/11/2018 - 213:20: [AMXX] Displaying debug trace (plugin "admincmdlogs.amxx")
L 10/11/2018 - 213:20: [AMXX] Run time error 10: native error (native "write_file")
L 10/11/2018 - 213:20: [AMXX] [0] admincmdlogs.sma::client_command (line 38 )
I believe this is line 38:

Quote:
write_file(logfile, text)
Anyone there to help?

Last edited by Alber9091; 10-11-2018 at 17:02.
Alber9091 is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 10-11-2018 , 17:29   Re: Plugin Request [Admin Command Logs]
Reply With Quote #6

change :

Code:
new configsdir[20];
to :

Code:
new configsdir[200];
__________________


D4rkSiD3Rs is offline
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 10-12-2018 , 05:53   Re: Plugin Request [Admin Command Logs]
Reply With Quote #7

Quote:
Originally Posted by D4rkSiD3Rs View Post
change :

Code:
new configsdir[20];
to :

Code:
new configsdir[200];
Hy, Thanks alot for the code but it logs all commands.
I mean to even it logs say, say Hello, fps_max 100, menuselect 2, every single keyword.

But I want to log only keywords having only amx_ and rcon if possible, instead of recording every single letter.

Last edited by Alber9091; 10-12-2018 at 06:24.
Alber9091 is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 10-12-2018 , 09:25   Re: Plugin Request [Admin Command Logs]
Reply With Quote #8

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

__________________


D4rkSiD3Rs is offline
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
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 10-12-2018 , 13:34   Re: Plugin Request [Admin Command Logs]
Reply With Quote #10

PHP Code:
#include <amxmodx>
#include <amxmisc>

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

new const 
g_Commands[][] =  
{
    
"amx_",
    
"amxmodmenu",
    
"rcon"
}

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_Commands); i++)
    {
        if(!(
containi(g_cmdLine1g_Commands[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

__________________


D4rkSiD3Rs is offline
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:57.


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