CSGO: Change nick
CSGO: Change nick
Is it possible to change player nick in game? If yes how?
Yes, it's possible, but requires the memory module. I guess we will add that functionality at some point, so you can just do player.name = <new name>: Note that this is only for Windows/CS:S. Though, you can easily adapt that for other games/Linux.
Syntax: Select all
import memory
from memory import Convention
from memory import DataType
from memory.hooks import PreHook
from engines.server import engine_server
from events import Event
from players.helpers import index_from_userid
engine = memory.find_binary('bin/engine')
SetName = engine[b'\x55\x8B\xEC\x83\xEC\x4C\x53\x6A\x20'].make_function(
Convention.THISCALL,
[DataType.POINTER, DataType.STRING],
DataType.VOID
)
sv = engine.find_pointer(b'\x55\x8B\xEC\x56\x8B\x75\x0C\x57\x85\xF6', 26, 1)
GetClient = sv.make_virtual_function(
6,
Convention.THISCALL,
[DataType.POINTER, DataType.INT],
DataType.POINTER
)
engine_server_ptr = memory.get_object_pointer(engine_server)
ClientCommand = engine_server_ptr.make_virtual_function(
38,
Convention.CDECL,
[DataType.POINTER, DataType.POINTER, DataType.STRING],
DataType.BOOL
)
@PreHook(ClientCommand)
def on_client_command(args):
if args[2] == 'name "%s"':
# Test accessing variadic arguments
#new_name = args.registers.esp.address.get_pointer().get_string_pointer(16)
#print(new_name)
return False
def set_player_name(index, new_name):
SetName(GetClient(sv, index-1) - 4, new_name)
@Event
def player_say(event):
userid = event.get_int('userid')
index = index_from_userid(userid)
new_name = event.get_string('text')
set_player_name(index, new_name)
The problem has been resolved in new version of plugin.
Example:
Example:
Syntax: Select all
@Event('player_activate')
def player_activate(game_event):
player = PlayerEntity(index_from_userid(game_event.get_int('userid')))
player.name = 'Just a test nick'
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 115 guests