Raised This Month: $ Target: $400
 0% 

Weapons' item definition indexes stay the same.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
SadScrub
Member
Join Date: May 2014
Old 06-01-2014 , 16:22   Weapons' item definition indexes stay the same.
Reply With Quote #1

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

Last edited by SadScrub; 06-01-2014 at 16:35.
SadScrub is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode