Remove "Player changed name to YY" message

Please post any questions about developing your plugin here. Please use the search function before posting!
decompile
Senior Member
Posts: 418
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Remove "Player changed name to YY" message

Postby decompile » Wed May 25, 2016 5:07 am

Hey,

Is there already a way to remove the "Player changed name to YY" message?

If there is a way it would be for sure possible to remove these too:

Code: Select all

Server cvar change: Server cvar 'sv_tags' changed to alltalk,increased_maxplayers..'
Connect: Player xxx has joined the game
Disconnect: Player xxx has left the game
Team change: Player xxx has joined team Terrorists
User avatar
Ayuto
Project Leader
Posts: 2210
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Remove "Player changed name to YY" message

Postby Ayuto » Wed May 25, 2016 7:38 am

Try this:

Syntax: Select all

from events.hooks import EventAction
from events.hooks import PreEvent

@PreEvent('server_cvar', 'player_team', 'player_connect', 'player_disconnect')
def pre_player_team(game_event):
return EventAction.STOP_BROADCAST
decompile
Senior Member
Posts: 418
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: Remove "Player changed name to YY" message

Postby decompile » Tue May 31, 2016 4:50 pm

Hey,

Tried it out, doesnt work (CSS: Windows + Linux)
User avatar
satoon101
Project Leader
Posts: 2725
Joined: Sat Jul 07, 2012 1:59 am

Re: Remove "Player changed name to YY" message

Postby satoon101 » Tue May 31, 2016 5:35 pm

Try adding player_changename to the event names arguments.
Image
decompile
Senior Member
Posts: 418
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: Remove "Player changed name to YY" message

Postby decompile » Thu Jun 02, 2016 2:18 pm

Still no difference, didnt worked in ES Too.

Syntax: Select all

def load():
spe.detourFunction('SayText2Filter', HookType.Pre, pre_saytext2)

def unload():
spe.undetourFunction('SayText2Filter', HookType.Pre, pre_saytext2)

def pre_saytext2(args):
if args[3] == '#Cstrike_Name_Change':
for x in xrange(3, 8):
args[x] = ''
return (HookAction.Modified, 0)

return (HookAction.Continue, 0)
User avatar
Ayuto
Project Leader
Posts: 2210
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Remove "Player changed name to YY" message

Postby Ayuto » Sat Jun 04, 2016 3:32 pm

decompile wrote:Hey,

Tried it out, doesnt work (CSS: Windows + Linux)
Just tested my code and everything you have requested is working except the name change part. You could have been more precise in your reply. :wink:

player_changename does get fired when a player changes his name, but it seems like we can't block the message by stopping the event from being broadcasted to the clients. However, hooking UTIL_SayText2Filter is working fine for me:

Syntax: Select all

import memory

from memory import Convention
from memory import DataType
from memory.hooks import PreHook

from core import PLATFORM

if PLATFORM == 'windows':
identifier = b'\x55\x8B\xEC\x68\x2A\x2A\x2A\x2A\xFF\x75\x08\xE8\x2A\x2A\x2A\x2A\x8B\x45\x0C'
else:
identifier = '_Z19UTIL_SayText2FilterR16IRecipientFilterP11CBasePlayerbPKcS4_S4_S4_S4_'

server = memory.find_binary('server')

UTIL_SayText2Filter = server[identifier].make_function(
Convention.CDECL,
[DataType.POINTER, DataType.POINTER, DataType.BOOL, DataType.STRING,
DataType.STRING, DataType.STRING, DataType.STRING, DataType.STRING],
DataType.VOID
)

@PreHook(UTIL_SayText2Filter)
def pre_say_text2_filter(args):
if args[3] == '#Cstrike_Name_Change':
return 0


Edit:
Stopping player_changename from being broadcasted has no effect, because CCSPlayer::ChangeName fires the event and calls UTIL_SayText2Filter.
decompile
Senior Member
Posts: 418
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: Remove "Player changed name to YY" message

Postby decompile » Wed Jun 08, 2016 3:18 pm

Works, awesome thank you!
decompile
Senior Member
Posts: 418
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: Remove "Player changed name to YY" message

Postby decompile » Fri Jul 08, 2016 2:51 pm

Ayuto wrote:Try this:

Syntax: Select all

from events.hooks import EventAction
from events.hooks import PreEvent

@PreEvent('server_cvar', 'player_team', 'player_connect', 'player_disconnect')
def pre_player_team(game_event):
return EventAction.STOP_BROADCAST


Seems like this does not work, it still says 'Player xx joined the game'
User avatar
Ayuto
Project Leader
Posts: 2210
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Remove "Player changed name to YY" message

Postby Ayuto » Sun Jul 10, 2016 6:53 am

Seems like they have changed the way that message gets display. I just tested "player_connect_client" and this does block the message.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: Bing [Bot] and 37 guests