Raised This Month: $ Target: $400
 0% 

Block StatusText when aiming at player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-05-2008 , 23:39   Block StatusText when aiming at player
Reply With Quote #1

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(1get_msg_argtype(1), 1)
        
set_msg_arg_int(2get_msg_argtype(2), 0)
    }

__________________
Bugsy is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-06-2008 , 02:54   Re: Block StatusText when aiming at player
Reply With Quote #2

You forgot to pass arguments in caller function.
Try this if it works:
PHP Code:
public plugin_init()
{
    
register_message(get_user_msgid("StatusValue"), "message_statusvalue")
}

public 
message_statusvalue(iMsgIdMSG_DESTid)
{
    if( 
g_PlayerToWatch == id && (get_msg_arg_int(1) == 2) && (get_msg_arg_int(2) == g_BotID) )
    {
        
set_msg_arg_int(1get_msg_argtype(1), 1)
        
set_msg_arg_int(2get_msg_argtype(2), 0)
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-06-2008 , 09:44   Re: Block StatusText when aiming at player
Reply With Quote #3

Quote:
Originally Posted by connorr View Post
You forgot to pass arguments in caller function.
Try this if it works:
....
I pasted your code into the aimbot plugin and it still wasn't working. Then I noticed I had a separate plugin running which I put together for the sole purpose of figuring this out. Once I disabled the other plugin it worked perfectly. It's possible my code worked the entire time but who knows.

+karma for the help

Here's the working code for anyone else trying to do this:

PHP Code:
register_message(get_user_msgid("StatusValue"), "func_StatusValue")

public 
func_StatusValue(iMsgIdMSG_DESTid)
{    
    
//g_BotID is the player being pointed at whos statustext you dont want shown
    //g_PlayerToWatch is the player pointing at g_BotID who u dont want to see statustext

    
if( (id == g_PlayerToWatch )  && (get_msg_arg_int(1) == 2) &&  (get_msg_arg_int(2) == g_BotID)  )
    {
        
set_msg_arg_int(1get_msg_argtype(1), 1)
        
set_msg_arg_int(2get_msg_argtype(2), 0)
    }    

__________________
Bugsy 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:45.


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