Page 1 of 1

Remove "Player changed name to YY" message

Posted: Wed May 25, 2016 5:07 am
by decompile
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

Re: Remove "Player changed name to YY" message

Posted: Wed May 25, 2016 7:38 am
by Ayuto
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

Re: Remove "Player changed name to YY" message

Posted: Tue May 31, 2016 4:50 pm
by decompile
Hey,

Tried it out, doesnt work (CSS: Windows + Linux)

Re: Remove "Player changed name to YY" message

Posted: Tue May 31, 2016 5:35 pm
by satoon101
Try adding player_changename to the event names arguments.

Re: Remove "Player changed name to YY" message

Posted: Thu Jun 02, 2016 2:18 pm
by decompile
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)

Re: Remove "Player changed name to YY" message

Posted: Sat Jun 04, 2016 3:32 pm
by Ayuto
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.

Re: Remove "Player changed name to YY" message

Posted: Wed Jun 08, 2016 3:18 pm
by decompile
Works, awesome thank you!

Re: Remove "Player changed name to YY" message

Posted: Fri Jul 08, 2016 2:51 pm
by decompile
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'

Re: Remove "Player changed name to YY" message

Posted: Sun Jul 10, 2016 6:53 am
by Ayuto
Seems like they have changed the way that message gets display. I just tested "player_connect_client" and this does block the message.