I'm trying to block a particular player from seeing another players status text when aimed at. I've searched and read many threads and tried quite a few snippets of code but none seem to work correctly. Either the statustext still shows, doesn't appear at all for any player, or shows and stays constant even after aiming away from a player.
Can anyone block status text for only a particular player?
I would like to implement this into my aimbot detection plugin to block the status text from showing when the watched player is aiming at the detection bot.
The most recent code I attempted below blocks statustext from showing for every player. It's as if my if statement doesn't exist.
+karma
from:
http://forums.alliedmods.net/showthr...ght=statustext
PHP Code:
plugin_init()
{
register_message(get_user_msgid("StatusValue"), "message_statusvalue")
}
public message_statusvalue()
{
if( g_PlayerToWatch && (get_msg_arg_int(1) == 2) && (get_msg_arg_int(2) == g_BotID) )
{
// Pretend the previous message never arrived
set_msg_arg_int(1, get_msg_argtype(1), 1)
set_msg_arg_int(2, get_msg_argtype(2), 0)
}
}
__________________