Raised This Month: $ Target: $400
 0% 

how do catch rcon log?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
3lgoOg
BANNED
Join Date: May 2008
Location: Hi, I'm rudle in a not s
Old 05-10-2008 , 07:27   Re: how do catch rcon log?
Reply With Quote #11

This should work

Updated.
PHP Code:
#include <amxmodx>

new g_iState

public plugin_init()
{
    
register_plugin("LogEvents Logger""1.0.0""connorr")
    
register_srvcmd("logevents""ServerCommand_LogEvents"_"<print> | <log> | <stop>")
}

public 
plugin_log()
{
    if(!
g_iState)
    {
        return
    }
   
    static 
szMain[256], szDetail[256], szRegistered[256], szIpent[32]
    static 
iArgsNumnmszTemp[64]
    
    
get_user_ip(0szIpent31)

    
read_logdata(szMain255)

    
iArgsNum read_logargc()

    
0
    m 
formatex(szRegistered255"register_logevent(^"function_name^", %d, "iArgsNum)

    for(new 
ii<iArgsNumi++)
    {
        
read_logargv(iszTemp63)
        
+= formatex(szDetail[n], 255-n"^n%d=%s"iszTemp)
        
+= formatex(szRegistered[m], 255-m"^"%d=%s^", "iszTemp)
    }
    
+= formatex(szRegistered[m], 255-m")^n")

    if(
g_iState==2)
    {
        static const 
logfile[] = "logevents.log"
        
log_to_file(logfile"%s^n%s%s^n%s"szIpentszMainszDetailszRegistered)
    }
    else
    {
        
server_print("%s^n%s%s^n%s"szIpentszMainszDetailszRegistered)
    }
}

public 
ServerCommand_LogEvents()
{
    new 
szArg1[6]
    
read_argv(1szArg15)

    static const 
szStates[][] = {"stop""print""log"}

    for(new 
ii<sizeof(szStates); i++)
    {
        if( 
equal(szArg1szStates[i]) && g_iState != )
        {
            
g_iState i
            
break
        }
    }

    
server_print("[LogEvents Logger] Currently : %s"szStates[g_iState])

3lgoOg is offline
 



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 08:03.


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