Page 1 of 1

Cs:go signatures

Posted: Sat Apr 11, 2015 9:06 am
by MrMalina
How do I get CBasePlayer::BumpWeapon and CBaseCombatCharacter::OnTakeDamage signatures for cs: go?

Posted: Sat Apr 11, 2015 9:35 am
by Predz
Malina, it is better to use the offsets provided inside the INI files. They create virtual functions that you can hook onto so no need to create your own as they already exist in SP.

Code: Select all

[virtual_function]
    # _ZN11CBaseEntity18PassesDamageFilterERK15CTakeDamageInfo
    [[take_damage]]
        offset_linux = 65
        offset_windows = 64
        arguments = POINTER

    # _ZN11CBasePlayer10BumpWeaponEP17CBaseCombatWeapon
    [[bump_weapon]]
        offset_linux = 442
        offset_windows = 441
        arguments = POINTER
        return_type = BOOL


Syntax: Select all

@PreHook(<PlayerEntity>.take_damage)
def damage_prehook(args):
pointer = args[0]
## Quickly written so cant remember if the arguments are correct for make_object.
info = memory.make_object(TakeDamageInfo, args[1])

Posted: Sat Apr 11, 2015 9:46 am
by MrMalina
I tried to do it, but because the server can not be a player ,i added the bot through bot_manager.create_bot("ponyawka"), but it server crash.

Syntax: Select all

players = tuple(PlayerIter(return_types="player"))
if players:
a = players[0].bump_weapon
else:
from players.bots import bot_manager

a = PlayerEntity(index_from_edict(bot_manager.create_bot("ponyawka"))).bump_weapon

Posted: Sat Apr 11, 2015 10:38 am
by satoon101
The offsets could have changed. I will be home later today and will try to remember to get the updated offsets.

Posted: Sat Apr 11, 2015 6:43 pm
by L'In20Cible
The offset didn't change and the code above didn't crash on my side.

Posted: Sat Apr 11, 2015 8:59 pm
by MrMalina
I load plugin with this code through the autoexec.cfg, then the server crashes.
If you load plugin after the start of the server, the server works fine

Posted: Sat Apr 11, 2015 9:05 pm
by L'In20Cible
That's normal. You can't add a bot at this time.