Raised This Month: $ Target: $400
 0% 

Hook message help (getting player name)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
turshija
Member
Join Date: Jan 2009
Old 10-09-2009 , 21:34   Hook message help (getting player name)
Reply With Quote #1

I'm developing private anti IP spam in chat that logs messages (in SQL) when someone tries to type IP address in his message and blocks that message from going into chat + optionally kick or ban player...
It logs Name, IP, date and message that player tried to send IP ...
For example, someone types:
"Great server! Join and get admin: 212.200.163.182:27025"
and it changes his message to something like: "I like to spam crap!" ...
So far I've managed to do everything with checking + changing message, but I just CAN'T find a way to get players name ... :S
If I try using get_user_name on (target), I just get current server name ... :S
help plox


PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_message(get_user_msgid("SayText"),"hook_message")
    (...)
}

public 
hook_message(target)
{
    if(
get_msg_argtype(4) != ARG_STRING)
    {
        return 
PLUGIN_CONTINUE
    
}
    
    new 
message[192]
    
get_msg_arg_string(4,message,sizeof message 1)
    (...)
    

turshija is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-09-2009 , 21:40   Re: Hook message help (getting player name)
Reply With Quote #2

See http://wiki.tcwonline.org/Half-Life_...Events#SayText

PHP Code:
static szName33 ];
get_user_nameget_msg_arg_int) , szName 32 ); 
__________________
Bugsy is offline
turshija
Member
Join Date: Jan 2009
Old 10-10-2009 , 09:36   Re: Hook message help (getting player name)
Reply With Quote #3

thanks K+
turshija 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 22:43.


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