Raised This Month: $12 Target: $400
 3% 

[TF2] Hide name change message - in-game.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ph
AlliedModders Donor
Join Date: Mar 2006
Old 11-24-2018 , 14:37   [TF2] Hide name change message - in-game.
Reply With Quote #1

I am looking for a TF2 plugin that will HIDE messages of name changes in-game.


Your help is much needed.
__________________

Last edited by ph; 11-24-2018 at 14:37.
ph is offline
JoinedSenses
Senior Member
Join Date: Sep 2013
Old 11-24-2018 , 16:34   Re: [TF2] Hide name change message - in-game.
Reply With Quote #2

Code:
#include <sourcemod>

public Plugin myinfo = {
	name = "Hide name change", 
	author = "JoinedSenses", 
	description = "Hides name changes", 
	version = "1.0.0", 
	url = ""
};


public void OnPluginStart() {
	HookUserMessage(GetUserMessageId("SayText2"), UserMessageHook, true);
}

public Action UserMessageHook(UserMsg msg_hd, BfRead bf, const int[] players, int playersNum, bool reliable, bool init) {
	char sMessage[96];
	bf.ReadString(sMessage, sizeof(sMessage));
	bf.ReadString(sMessage, sizeof(sMessage));
	if (StrContains(sMessage, "Name_Change") != -1) {
		return Plugin_Handled;
	}
	return Plugin_Continue;
}
JoinedSenses is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 11-25-2018 , 00:32   Re: [TF2] Hide name change message - in-game.
Reply With Quote #3

Quote:
Originally Posted by JoinedSenses View Post
Code:
#include <sourcemod>

public Plugin myinfo = {
	name = "Hide name change", 
	author = "JoinedSenses", 
	description = "Hides name changes", 
	version = "1.0.0", 
	url = ""
};


public void OnPluginStart() {
	HookUserMessage(GetUserMessageId("SayText2"), UserMessageHook, true);
}

public Action UserMessageHook(UserMsg msg_hd, BfRead bf, const int[] players, int playersNum, bool reliable, bool init) {
	char sMessage[96];
	bf.ReadString(sMessage, sizeof(sMessage));
	bf.ReadString(sMessage, sizeof(sMessage));
	if (StrContains(sMessage, "Name_Change") != -1) {
		return Plugin_Handled;
	}
	return Plugin_Continue;
}
I think you should also include if(Message[0] == '#')
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 11-25-2018 , 23:28   Re: [TF2] Hide name change message - in-game.
Reply With Quote #4

Why are you calling bf.ReadString twice?
ThatKidWhoGames is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 11-28-2018 , 05:29   Re: [TF2] Hide name change message - in-game.
Reply With Quote #5

Quote:
Originally Posted by ThatKidWhoGames View Post
Why are you calling bf.ReadString twice?
IIRC it's like datapacks, but you might be able to go to next without reading.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
ph
AlliedModders Donor
Join Date: Mar 2006
Old 12-01-2018 , 23:41   Re: [TF2] Hide name change message - in-game.
Reply With Quote #6

Quote:
Originally Posted by ThatKidWhoGames View Post
Why are you calling bf.ReadString twice?

The final version will be nice once posted with the amendments.
__________________
ph is offline
Reply


Thread Tools
Display Modes

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 10:50.


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