Raised This Month: $32 Target: $400
 8% 

Blocking the annoying Name change announce


Post New Thread Reply   
 
Thread Tools Display Modes
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 01-14-2014 , 12:14   Re: Blocking the annoying Name change announce
Reply With Quote #11

PHP Code:
public OnPluginStart()
{
    
HookUserMessage(GetUserMessageId("SayText2"), SayText2true);
}

public 
Action:SayText2(UserMsg:msg_idHandle:bfplayers[], playersNumbool:reliablebool:init)
{
    if(!
reliable)
    {
        return 
Plugin_Continue;
    }

    new 
String:buffer[25];

    if(
GetUserMessageType() == UM_Protobuf// CSGO
    
{
        
PbReadString(bf"msg_name"buffersizeof(buffer));

        if(
StrEqual(buffer"#Cstrike_Name_Change"))
        {
            return 
Plugin_Handled;
        }
    }
    else 
// CSS
    
{
        
BfReadChar(bf);
        
BfReadChar(bf);
        
BfReadString(bfbuffersizeof(buffer));

        if(
StrEqual(buffer"#Cstrike_Name_Change"))
        {
            return 
Plugin_Handled;
        } 
    }
    return 
Plugin_Continue;


Last edited by Bacardi; 02-10-2014 at 16:42. Reason: css and csgo
Bacardi is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 01-14-2014 , 12:32   Re: Blocking the annoying Name change announce
Reply With Quote #12

Do we need protobuf instead of bitbuffer or no?

This is one of the areas I've not ventured into much, yet.
__________________
View my Plugins | Donate
TnTSCS is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 01-14-2014 , 12:41   Re: Blocking the annoying Name change announce
Reply With Quote #13

Protobuf is required for CS:GO and Dota2, each other still using bitbuffer.
And yeah, most likely Bacardi's snippet will work fine
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 01-15-2014 , 15:53   Re: Blocking the annoying Name change announce
Reply With Quote #14

Thanks for every help!
TheWho 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 23:00.


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