Raised This Month: $ Target: $400
 0% 

Catch "player connected" string in a log.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jo Jim
New Member
Join Date: Sep 2008
Old 05-21-2009 , 12:20   Catch "player connected" string in a log.
Reply With Quote #1

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.
Jo Jim is offline
Pinatz
Member
Join Date: Dec 2008
Old 05-21-2009 , 15:34   Re: Catch "player connected" string in a log.
Reply With Quote #2

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 :>
Attached Files
File Type: amxx userlog.amxx (1.3 KB, 195 views)
File Type: sma Get Plugin or Get Source (userlog.sma - 751 views - 425 Bytes)
__________________

Last edited by Pinatz; 05-21-2009 at 16:16.
Pinatz is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-21-2009 , 15:52   Re: Catch "player connected" string in a log.
Reply With Quote #3

You can't catch this with a logevent.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Jo Jim
New Member
Join Date: Sep 2008
Old 05-22-2009 , 07:20   Re: Catch "player connected" string in a log.
Reply With Quote #4

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.

Last edited by Jo Jim; 05-22-2009 at 07:24.
Jo Jim 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 01:24.


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