AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Catch "player connected" string in a log. (https://forums.alliedmods.net/showthread.php?t=92880)

Jo Jim 05-21-2009 12:20

Catch "player connected" string in a log.
 
Hi,
For some purpose i would like to catch the string in the log like
L 05/21/2009 - 19:52:20: "NickName<1082><4294967295><>" connected, address "XXX.XXX.XXX.XXX:XXXX"
I would like to do it with register_logevent() command. But there are some tricks for this particular case. I did not found similar example. I tried several combinations but all of them don't work. I believe there is something very simple what i can't see.
Could somebody please help to bring the following code in order.
Code:

public plugin_init ()
{
    register_plugin ( PLUGIN, VERSION, AUTHOR )
    log_message("[AMXX] Connect_catch")
    register_logevent( "event_user_connected", 3, "1=connected, address" )
    return PLUGIN_CONTINUE
}
public event_user_connected()
{
    new Arg0[64], Arg2[64],
    read_logargv(0,Arg0,63)
    read_logargv(2,Arg2,63)
    log_message("[AMXX] Connect_catch:", Arg0, Arg2)
    return PLUGIN_CONTINUE
}

I believe there is something wrong with comma. Maybe it makes 4 parameters instead of 3. I tried:
Code:

register_logevent( "event_user_connected", 4, "1=connected" "2=address" )
It don't work either.

Pinatz 05-21-2009 15:34

Re: Catch "player connected" string in a log.
 
2 Attachment(s)
Try this (attached)

PHP Code:

public client_connect(id) {
    new 
gid[32],name[32],gip[33];
    
get_user_name(idname32)
    
get_user_authid idgid30 
    
get_user_ip(id,gip,32,1)
    
log_amx("User connected: Name is %s, SteamID is %s. IP - %s",name,gid,gip)


I hope this is what you want to do :>

ConnorMcLeod 05-21-2009 15:52

Re: Catch "player connected" string in a log.
 
You can't catch this with a logevent.

Jo Jim 05-22-2009 07:20

Re: Catch "player connected" string in a log.
 
I need to filter some "bad" connections to server and this connection are not caught by client_connect or client_connecting or client_authorized. These connections are seen in server log only...
So if it is not possible to catch it with logevent then... don't know what then.

Anyway thank you for help. I appreciate it.


All times are GMT -4. The time now is 01:24.

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