Cs:go signatures

Please post any questions about developing your plugin here. Please use the search function before posting!
MrMalina
Member
Posts: 53
Joined: Mon Apr 08, 2013 2:40 pm
Location: Russian Federation

Cs:go signatures

Postby MrMalina » Sat Apr 11, 2015 9:06 am

How do I get CBasePlayer::BumpWeapon and CBaseCombatCharacter::OnTakeDamage signatures for cs: go?
Predz
Senior Member
Posts: 158
Joined: Wed Aug 08, 2012 9:05 pm
Location: Bristol, United Kingdom

Postby Predz » Sat Apr 11, 2015 9:35 am

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])
MrMalina
Member
Posts: 53
Joined: Mon Apr 08, 2013 2:40 pm
Location: Russian Federation

Postby MrMalina » Sat Apr 11, 2015 9:46 am

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
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Sat Apr 11, 2015 10:38 am

The offsets could have changed. I will be home later today and will try to remember to get the updated offsets.
Image
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Postby L'In20Cible » Sat Apr 11, 2015 6:43 pm

The offset didn't change and the code above didn't crash on my side.
MrMalina
Member
Posts: 53
Joined: Mon Apr 08, 2013 2:40 pm
Location: Russian Federation

Postby MrMalina » Sat Apr 11, 2015 8:59 pm

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
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Postby L'In20Cible » Sat Apr 11, 2015 9:05 pm

That's normal. You can't add a bot at this time.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 150 guests