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

Hide Namechange


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tumtum
Senior Member
Join Date: Aug 2012
Old 02-10-2014 , 05:52   Hide Namechange
Reply With Quote #1

Can someone help me with creating this for CS:GO:
Plugin Start:
Code:
HookUserMessage(GetUserMessageId("SayText2"), UserMessage_SayText2, true);
Code:
public Action:UserMessage_SayText2(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init)
{
	decl String:message[256];

	BfReadShort(bf); // team color

	BfReadString(bf, message, sizeof(message));
	// check for Name_Change, not #TF_Name_Change (compatibility?)
	if (StrContains(message, "Name_Change") != -1)
	{
		BfReadString(bf, message, sizeof(message)); // original
		BfReadString(bf, message, sizeof(message)); // new
		if (FindStringInArray(bot_names, message) != -1)
		{
			// 'tis a bot!
			return Plugin_Handled;
		}
	}

	return Plugin_Continue;
}
Link: https://forums.alliedmods.net/showthread.php?t=101768

Last edited by tumtum; 02-10-2014 at 05:53.
tumtum is offline
Marcus_Brown001
AlliedModders Donor
Join Date: Nov 2012
Location: Illinois, United States
Old 02-10-2014 , 07:15   Re: Hide Namechange
Reply With Quote #2

You were not too forthcoming about when you want this blocked. From the snippet supplied, it looks like you want it to suppress when a bot's name changes.

PHP Code:
public OnPluginStart()
{
    
HookEvent("player_changename"Event_NameChangeEventHookMode_Pre);
}

public 
Action:Event_NameChange(Handle:hEvent, const String:sName[], bool:bBroadcast)
{
    new 
iClient GetClientOfUserId(GetEventInt(hEvent"userid"));

    if (
IsFakeClient(iClient))
    {
        
SetEventBroadcast(hEventtrue);

        return 
Plugin_Changed;
    }
    
    return 
Plugin_Continue;

Marcus_Brown001 is offline
tumtum
Senior Member
Join Date: Aug 2012
Old 02-10-2014 , 07:18   Re: Hide Namechange
Reply With Quote #3

Quote:
Originally Posted by Marcus_Brown001 View Post
You were not too forthcoming about when you want this blocked. From the snippet supplied, it looks like you want it to suppress when a bot's name changes.

PHP Code:
public OnPluginStart()
{
    
HookEvent("player_changename"Event_NameChangeEventHookMode_Pre);
}

public 
Action:Event_NameChange(Handle:hEvent, const String:sName[], bool:bBroadcast)
{
    new 
iClient GetClientOfUserId(GetEventInt(hEvent"userid"));

    if (
IsFakeClient(iClient))
    {
        
SetEventBroadcast(hEventtrue);

        return 
Plugin_Changed;
    }
    
    return 
Plugin_Continue;

That's Right its from the Automatic Bot Names plugin, want this fixed for csgo
tumtum is offline
tumtum
Senior Member
Join Date: Aug 2012
Old 02-10-2014 , 13:18   Re: Hide Namechange
Reply With Quote #4

Someone have a working version? Seems it is not working ^^
tumtum is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-10-2014 , 16:42   Re: Hide Namechange
Reply With Quote #5

https://forums.alliedmods.net/showpo...6&postcount=11
Bacardi is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 02-10-2014 , 16:59   Re: Hide Namechange
Reply With Quote #6

May I ask how this can be done for TF2?

And also block team change ;o


Also I notice SetClientInfo with sm_rename often lags a few seconds before the name is actually changed, can it be changed instantly?
__________________

Last edited by Chdata; 02-10-2014 at 17:01.
Chdata is offline
tumtum
Senior Member
Join Date: Aug 2012
Old 02-10-2014 , 17:02   Re: Hide Namechange
Reply With Quote #7

Quote:
Originally Posted by Bacardi View Post
Thanks! works

For TF2 Replace
#Cstrike_Name_Change
With
#TF2_Name_Change

in this code.
https://forums.alliedmods.net/showpo...6&postcount=11

Block teamchange is different.

Last edited by tumtum; 02-10-2014 at 17:03.
tumtum is offline
Marcus_Brown001
AlliedModders Donor
Join Date: Nov 2012
Location: Illinois, United States
Old 02-10-2014 , 18:50   Re: Hide Namechange
Reply With Quote #8

My bad, I didn't know that it worked different inside CS:GO.
Marcus_Brown001 is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 02-12-2014 , 16:02   Re: Hide Namechange
Reply With Quote #9

Quote:
Originally Posted by tumtum View Post
Thanks! works

For TF2 Replace
#Cstrike_Name_Change
With
#TF2_Name_Change

in this code.
https://forums.alliedmods.net/showpo...6&postcount=11

Block teamchange is different.
Might you know how? And how'd you find "#TF2_Name_Change"?
__________________
Chdata is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-12-2014 , 18:08   Re: Hide Namechange
Reply With Quote #10

Quote:
Originally Posted by Chdata View Post
And how'd you find "#TF2_Name_Change"?
tf_english.txt

It's a Valve translation phrase.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-12-2014 at 18:09.
Powerlord 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 18:12.


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