Raised This Month: $ Target: $400
 0% 

Remove StatusText


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-11-2009 , 18:20   Re: Remove StatusText
Reply With Quote #8

Quote:
Originally Posted by ConnorMcLeod View Post
I'm using this in client_prethink and it works as expected (both StatusValue and StatusText are BLOCK_SET):
So you're saying that this works?
PHP Code:
new g_msgStatusText;
new 
g_msgStatusValue;

new 
g_MaxPlayers;

public 
plugin_init()
{
    
register_forward(FM_PlayerPreThink"fwdPlayerPreThink"0);
    
    
g_msgStatusText get_user_msgid("StatusText");
    
g_msgStatusValue get_user_msgid("StatusValue");
    
    
set_msg_block(g_msgStatusTextBLOCK_SET);
    
set_msg_block(g_msgStatusValueBLOCK_SET);
    
    
g_MaxPlayers global_get(glb_maxClients);
}

public 
fwdPlayerPreThink(plr)
{
    if( 
is_user_alive(plr) )
    {
        static 
old_target[33];
        static 
reset[33];
        
        new 
targetbody;
        
get_user_aiming(plrtargetbody9999);
        
        if( 
target <= g_MaxPlayers && is_user_alive(target) )
        {
            new 
old old_target[plr];
            
            if( !
old )
            {
                
message_begin(MSG_ONE_UNRELIABLEg_msgStatusValue_plr);
                
write_byte(1);
                
write_short((((!!(cs_get_user_team(plr) == cs_get_user_team(target))) + 1) % 2) + 1);
                
message_end();
            }
            
            if( 
old != target )
            {
                
old_target[plr] = target;
                
message_begin(MSG_ONE_UNRELIABLEg_msgStatusValue_plr);
                
write_byte(2);
                
write_short(target);
                
message_end();
            }
            
            if( !
old )
            {
                
message_begin(MSG_ONE_UNRELIABLEg_msgStatusText_plr);
                
write_byte(0);
                
write_string("1 %p2");
                
message_end();
            }
        }
        else
        {
            if( 
old_target[plr] )
            {
                
reset[plr] = 100;
                
old_target[plr] = 0;
            }
            else if( 
reset[plr] > && --reset[plr] == )
            {
                
message_begin(MSG_ONE_UNRELIABLEg_msgStatusValue_plr);
                
write_byte(1);
                
write_short(0);
                
message_end();
            }
        }
    }

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
 



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:28.


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