View Single Post
Author Message
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 02-15-2016 , 21:58   [TF2] Getting CEconItemView
Reply With Quote #1

CTFPlayer::ReapplyItemUpgrades takes in a CTFPlayer and a CEconItemView as parameters.

From an item entity index returned by TF2Items_GiveNamedItem, is there a way to get the CEconItemView of that item to pass into that function?

Some people told me that's only accessible from an extension only, but I noticed here that psychonic managed to be able to send in a CEconItemView to CTFDroppedWeapon::Create.

CTFPlayer::ReapplyItemUpgrades is called in MvM to apply upgrades purchased from the upgrades station to the players' weapons. I want to call this after an item from TF2Items is generated since GiveNamedItem doesn't call CTFPlayer::ReapplyItemUpgrades (and therefore, when a player respawns, the upgrades don't *always* appear on the item given by TF2Items).

So something like this would occur in the plugin:

PHP Code:
int ItemEntity TF2Items_GiveNamedItem(clienthItem);
CloseHandle(hItem);
SDKCall(ReapplyItemUpgradesclient, ????); 
The ???? is the CEconItemView. What do I put in there? Also, how do I prep the sdkcall for this function? (I have the gamedata already.) Any insight or advice would be helpful. Thanks!
Potato Uno is offline