Hello. I've lurked around the TF2Items section of this forum, but so far I've found nothing that resembled my issue (if there is something, I apologize).
Lately, I've been messing around with SP and TF2Items, and when I'm spawning weapons via this function:
Code:
new Handle:hWeapon = TF2Items_CreateItem(OVERRIDE_CLASSNAME | OVERRIDE_ITEM_DEF | FORCE_GENERATION | PRESERVE_ATTRIBUTES);
new String:classname[MAX_CLASSNAME_SIZE];
TF2Items_SetItemIndex(hWeapon, index);
TF2II_GetItemClass(index, classname, sizeof(classname), TFClassType:class);
TF2Items_SetClassname(hWeapon, classname);
new wEntity = TF2Items_GiveNamedItem(UserSlot, hWeapon);
CloseHandle(hWeapon);
EquipPlayerWeapon(client, wEntity);
Everything seems to be working and looking fine. But some items don't seem to be behaving as intended (consumables like the Sandvich cannot be eaten, but Bonk! works; also, taunts do not correspond with equipped weapons, only default ones are used).
When I check the item definition indexes of my current weapons with this:
Code:
entityStorage = GetPlayerWeaponSlot(slot, i);
if ( GetEntProp(entityStorage, Prop_Send, "m_iItemDefinitionIndex") != index )
PrintToServer("Slot %i is fine", i);
GetEntProp seems to only return the values of stock weapon indexes. I'd really appreciate any advice, this has been bugging me for a couple of days now