Page 1 of 1

dyncall question

Posted: Sun Dec 02, 2012 1:56 am
by Tuck
[CCSPlayer::CSWeaponDrop]
shortname = "DropWeapon"
sig = " 55 8B EC 81 EC 2A 2A 2A 2A 53 56 8B 75 08 32 DB 57"
symbol = _ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeaponbb
module = csgo/bin/server
arguments = ppbb
return_type = i
convention = thiscall

what arguments do i need to pass ? :/


A second question i have is, would it be possible to do some kinda code so players do not try to pick up guns instead of making them drop them on item_pickup ?

Posted: Sun Dec 02, 2012 2:25 am
by satoon101
In order to stop players from picking weapons up, we need Dynamic Function "Hooking", which is not implemented, yet.

The arguments you need to pass are just like in this example:
http://www.sourcepython.com/showthread.php?205-Stripping-weapons&p=980&viewfull=1#post980

Using a PlayerEntity (or BaseEntity) instance, will automatically push the entity's own pointer in the proper position. Notice in your ../addons/source-python/_libs/_data/functions/player/csgo.ini:

Code: Select all

[drop_weapon]
name = "DropWeapon"
pointer = 0
We set the PlayerEntity "drop_weapon" method to utilize the SignatureDictionary item "DropWeapon". And the entity's pointer, since it is set to the index of 0, will be the first object pushed.

So, first it pushes the player's pointer, then it pushes the specific weapon's pointer, then it pushes a bool value (not sure what the first bool is for), last it pushes a bool value for whether or not to "throw" the weapon (True being that it should be thrown, False that it should be simply dropped). If you use PlayerEntity, you will only need to pass the weapon's pointer and the 2 bool values. If you use SignatureDictionary or Binutils directly, you will need to pass/push the player's pointer first.

Satoon

Posted: Sun Dec 02, 2012 2:44 am
by Tuck
is Dynamic Function hooking on source pythons todo list i would love the features it comes with :)

Posted: Sun Dec 02, 2012 2:47 am
by satoon101
Yes, it most certainly is. I certainly cannot wait until they are implemented as well as getting/setting offsets directly.

Satoon