PDA

View Full Version : Add TF2Items_EquipPlayerWearable


Powerlord
06-16-2013, 06:08
As you already know, weapons can be equipped by using the EquipPlayerWeapon function.

However, this doesn't work for any equippable items that aren't weapons, which is all items of the classes tf_wearable, tf_wearable_demoshield, and tf_powerup_bottle.

Since TF2 has a function for this on CBasePlayer and pretty much every plugin using TF2Items that wants to give out Soldier boots, DemoMan shields, or Sniper shields needs this function, I propose adding a wrapper for this function into TF2Items itself.

It basically just needs to be a wrapper around CBasePlayer::EquipWearable, which is currently offsets 424 Windows and 425 Linux/Mac in the player offsets.

Alternately, I could file this bug on AlliedModders to get it added to the tf2 extension or sdktools_functions if it's a multi-game thing (i.e. also used in DOTA2; CS:GO has it in CBaseCombatCharacter, but I don't think CS:GO actually uses wearables).

friagram
06-17-2013, 03:36
Can
I
Equip
Hats
?

Powerlord
06-17-2013, 11:45
Can
I
Equip
Hats
?
They'll be invisible which would defeat the entire point.

friagram
06-17-2013, 12:34
This was a joke. Though i have noticed tf2items generated weapons becoming visible when the item servers are down, or when the server first comes online.

Merbo
06-21-2013, 16:34
I also would like this, if it helps weigh in at any amount.