Raised This Month: $ Target: $400
 0% 

Remove StatusText


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shine771
Senior Member
Join Date: Jun 2007
Old 05-11-2009 , 13:24   Remove StatusText
Reply With Quote #1

Hello, is it possible to remove StatusText after it's set manually? Like:
PHP Code:
    message_begin(MSG_ONE_UNRELIABLE,g_MsgStatusText,_,id)
    
write_byte(0)
    
write_string("Hello")
    
message_end() 
I tried:
PHP Code:
    message_begin(MSG_ONE_UNRELIABLE,g_MsgStatusText,_,id)
    
write_byte(0)
    
write_string("")
    
message_end() 
Aiming on teammates doesn't work anymore(until round end). Maybe i have to set StatusValue to something to remove it properly?
shine771 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-11-2009 , 13:31   Re: Remove StatusText
Reply With Quote #2

Just send a StatusValue msg with arg1 = 1 and arg2 = 0
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Old 05-11-2009, 13:31
zacky
This message has been deleted by zacky.
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-11-2009 , 13:34   Re: Remove StatusText
Reply With Quote #4

PHP Code:
    message_begin(MSG_ONE_UNRELIABLE,g_MsgStatusText,_,id)
    
write_byte(0)
    
write_string(" ")
    
message_end() 
__________________
xPaw is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-11-2009 , 13:35   Re: Remove StatusText
Reply With Quote #5

Yeah you have to play with StatusValue. Both works together.

[Edit] Wow. I'm too slow.
Arkshine is offline
shine771
Senior Member
Join Date: Jun 2007
Old 05-11-2009 , 13:59   Re: Remove StatusText
Reply With Quote #6

@Connor - Doesn't work
@xPaw - I think you didn't understand. I can get rid of that message, but when i look at teammates, it doesn't show their names anymore.
@Arkshine - I tried, alot, no success.

Help.
shine771 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-11-2009 , 16:39   Re: Remove StatusText
Reply With Quote #7

Quote:
Originally Posted by shine771 View Post
@Connor - Doesn't work
I'm using this in client_prethink and it works as expected (both StatusValue and StatusText are BLOCK_SET):
PHP Code:
    static iPlayercrap
    get_user_aiming
(idiPlayercrap)
    if( 
Is_PlayeriPlayer ) )
    {
        static 
iOldPlayer
        iOldPlayer 
g_iTarget[id]

        if( !
iOldPlayer )
        {
            
message_begin(MSG_ONE_UNRELIABLEgmsgStatusValue_id)
            
write_byte(1)
            
write_short(2)
            
message_end()
        }

        if( 
iOldPlayer != iPlayer )
        {
            
g_iTarget[id] = iPlayer
            message_begin
(MSG_ONE_UNRELIABLEgmsgStatusValue_id)
            
write_byte(2)
            
write_short(iPlayer)
            
message_end()
        }

        if( !
iOldPlayer )
        {
            static const 
szStatusText[] = "1 %p2"
            
message_begin(MSG_ONE_UNRELIABLEgmsgStatusText_id)
            
write_byte(0)
            
write_string(szStatusText)
            
message_end()
        }
    }
    else
    {
        if( 
g_iTarget[id] )
        {
            
g_iResetStatusText[id] = 100
            g_iTarget
[id] = 0
            
        
}
        else if( --
g_iResetStatusText[id] == )
        {
            
message_begin(MSG_ONE_UNRELIABLEgmsgStatusValue_id)
            
write_byte(1)
            
write_short(0)
            
message_end()
        }
    } 
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
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
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-11-2009 , 18:33   Re: Remove StatusText
Reply With Quote #9

In fact i was wrong, i don't block msgs, but code works fine.
The game don't send messages with skyjur semiclip method.

HL set all this stuff in UpdateClientData.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-11-2009 at 18:43.
ConnorMcLeod is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-11-2009 , 16:17   Re: Remove StatusText
Reply With Quote #10

Check if this works.
Code:
#include <amxmodx>   public plugin_init() {         register_plugin("Remove Custom StatusText", "1.0", "hleV");         register_message(get_user_msgid("StatusText"), "StatusTextMessage"); }   public StatusTextMessage() {         static ArgumentString[16];         get_msg_arg_string(2, ArgumentString, 15);           if (contain(ArgumentString, "%c1") == -1) // Also try "%p2"                 set_msg_arg_string(2, ""); }
__________________

Last edited by hleV; 05-11-2009 at 16:26.
hleV 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:28.


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