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(PLUGIN, VERSION, AUTHOR)
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)
(...)
}