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

Blocking the annoying Name change announce


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 01-13-2014 , 11:09   Blocking the annoying Name change announce
Reply With Quote #1

Hello,

Does anyone has a snippet to block the annoying name changes that are printed in the chat.
I think there client side only ... maybe

I really tried a lot of things like:

PHP Code:
HookEvent("player_changename"Event_PlayerChangenameEventHookMode_Pre); 
with SetEventBroadcast(event, true) and also return Plugin_Handled..

or

PHP Code:
HookEvent("player_info"Event_PlayerInfoEventHookMode_Pre); 
with SetEventBroadcast(event, true) and also return Plugin_Handled..

or

PHP Code:
HookEvent("server_cvar"Event_CvarEventHookMode_Pre); 
with SetEventBroadcast(event, true) and also return Plugin_Handled..

I think that I forget something what I tried but wayne sorry

Hopely somebody can help me.
And my other question is what is the really first ever at clients connection to the server with the information which is the name of a client?

PHP Code:
HookEvent("player_connect"Event_PlayerConnectEventHookMode_Pre); 
or
PHP Code:
public OnClientConnected(client){ 
or
PHP Code:
public OnClientConnect(client){ 
or do you have more ideas which is the first ever with clients name information..

Kind reguards
TheWho
TheWho is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-13-2014 , 11:53   Re: Blocking the annoying Name change announce
Reply With Quote #2

That doesn't look like AMX Mod X scripting. I'm guessing it's SourceMod. You should post in the SourceMod section of the forums.
__________________
fysiks is offline
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 01-13-2014 , 16:57   Re: Blocking the annoying Name change announce
Reply With Quote #3

Aww I'm sorry *facepalm*
TheWho is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 01-13-2014 , 17:01   Re: Blocking the annoying Name change announce
Reply With Quote #4

This "should" work... untested though. Perhaps the way the name is tied to steam now, the player_changename doesn't get fired...

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

public 
Action:OnPlayerChangeName(Handle:event, const String:name[], bool:dontBroadcast)
{
    
SetEventBroadcast(eventtrue);
    
    return 
Plugin_Continue;

__________________
View my Plugins | Donate

Last edited by TnTSCS; 01-13-2014 at 17:01.
TnTSCS is offline
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 01-13-2014 , 17:45   Re: Blocking the annoying Name change announce
Reply With Quote #5

Exactly the same I tried too :/
It will broadcast anyways..

At the moment I really think, that this now is a bit client-side since the "sv_namechange_cooldown_seconds" update.

I tried too to block everything with Chat but maybe its not chat, its more like cvar, cvar "name" maybe.
And this cvar will sind a PrintToChat to everyone, on change.

edit:
Quote:
the player_changename doesn't get fired...
So true
But steam don't have acces to the chat..

Maybe it works like this: Steam Server-> Gameserver-> Chat
But when it is like this, it's able to block the chat announce.. hmm

Otherwise: Steam Server-> Chat
Never ever.. Or what do you think from where it comes

Last edited by TheWho; 01-13-2014 at 18:03.
TheWho is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 01-13-2014 , 18:03   Re: Blocking the annoying Name change announce
Reply With Quote #6

Is it just me or does SetEventBroadcast's second argument mildly bother anyone else? It's like having a function called BeginIgnite which will only ignite if you provide false as a parameter.
__________________
11530 is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 01-13-2014 , 18:10   Re: Blocking the annoying Name change announce
Reply With Quote #7

Code:
public OnPluginStart() {     HookEvent("player_changename", OnPlayerChangeName, EventHookMode_Pre); } public Action:OnPlayerChangeName(Handle:event, const String:name[], bool:dontBroadcast) {     dontBroadcast = true;     return Plugin_Changed; }
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot

Last edited by Root_; 01-13-2014 at 18:10. Reason: [pawn][/pawn]
Root_ is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 01-13-2014 , 18:13   Re: Blocking the annoying Name change announce
Reply With Quote #8

I was going to put Plugin_Changed, but in one of my plugins, for the player_connect event, I used Plugin_Continue and it blocks the announcement... so I didn't think it needed it, but maybe plugin_changed works?

Another way to test if player_changename fires is to add debug print:
PHP Code:
public OnPluginStart()
{
    
HookEvent("player_changename"OnPlayerChangeNameEventHookMode_Pre);
}

public 
Action:OnPlayerChangeName(Handle:event, const String:name[], bool:dontBroadcast)
{
    
PrintToChatAll("OnPlayerChangeName fired...");

__________________
View my Plugins | Donate
TnTSCS is offline
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 01-14-2014 , 11:17   Re: Blocking the annoying Name change announce
Reply With Quote #9

Quote:
Originally Posted by TnTSCS View Post
I was going to put Plugin_Changed, but in one of my plugins, for the player_connect event, I used Plugin_Continue and it blocks the announcement... so I didn't think it needed it, but maybe plugin_changed works?

Another way to test if player_changename fires is to add debug print:
PHP Code:
public OnPluginStart()
{
    
HookEvent("player_changename"OnPlayerChangeNameEventHookMode_Pre);
}

public 
Action:OnPlayerChangeName(Handle:event, const String:name[], bool:dontBroadcast)
{
    
PrintToChatAll("OnPlayerChangeName fired...");

I know but I never really doubted that it won't gefired, but .. it won't be

Quote:
Originally Posted by Root_ View Post
Code:
public OnPluginStart()
{ HookEvent("player_changename", OnPlayerChangeName, EventHookMode_Pre);
}


public Action:OnPlayerChangeName(Handle:event, const String:name[], bool:dontBroadcast){
dontBroadcast = true; return Plugin_Changed;
}
Thanks but it just does not work on this way, I think it's patched the since last update I told in a earlier post.

I fragile my head for a long time about it, after all I want your advice.
I'm sorry that I say that you're just as far as me

edit:
Aww and sorry, I'am talking about CS:S

Last edited by TheWho; 01-14-2014 at 11:24.
TheWho is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 01-14-2014 , 12:07   Re: Blocking the annoying Name change announce
Reply With Quote #10

I know there's a way to analyse server messages and block them, but I can't remember how.

HookUserMessage maybe?

https://wiki.alliedmods.net/User_Messages

Eh, maybe not...

Eh, I guess I was right - https://forums.alliedmods.net/showpo...6&postcount=11
__________________
View my Plugins | Donate

Last edited by TnTSCS; 01-14-2014 at 12:16.
TnTSCS 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 15:00.


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