dyncall question

Please post any questions about developing your plugin here. Please use the search function before posting!
Tuck
Global Moderator
Posts: 205
Joined: Sat Jul 14, 2012 9:35 pm
Location: Copenhagen

dyncall question

Postby Tuck » Sun Dec 02, 2012 1:56 am

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

Postby satoon101 » Sun Dec 02, 2012 2:25 am

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
Tuck
Global Moderator
Posts: 205
Joined: Sat Jul 14, 2012 9:35 pm
Location: Copenhagen

Postby Tuck » Sun Dec 02, 2012 2:44 am

is Dynamic Function hooking on source pythons todo list i would love the features it comes with :)
-Tuck
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Sun Dec 02, 2012 2:47 am

Yes, it most certainly is. I certainly cannot wait until they are implemented as well as getting/setting offsets directly.

Satoon

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 42 guests