Get slot of tf_wearable?
How can I get the slot # of a tf_wearable through TF2Items_OnGiveNamedItem
|
Re: Get slot of tf_wearable?
Any particular reason you need to know the slot number?
Hell, TF2 can't even get cosmetic items slots correct for its own internal functions, such as CTFPlayer::GetEntityForLoadoutSlot, which returns nothing for slots 7 or 10, which are cosmetic 1 and 3 respectively. For reference, loadout slots are: 0 = Primary 1 = Secondary 2 = Melee 3 = Utility 4 = Building 5 = Unknown 6 = PDA2 7 = Misc 8 = Misc 9 = Action 10 = Misc 11 = Taunt 12 = Taunt 13 = Taunt 14 = Taunt 15 = Taunt 16 = Taunt 17 = Taunt 18 = Taunt Note: This was taken from g_szLoadoutStringsForDisplay in server_srv.so a while back, so Valve may have given them better names since then. |
Re: Get slot of tf_wearable?
Quote:
|
Re: Get slot of tf_wearable?
Is there another way I can check if a player has an item on?
|
Re: Get slot of tf_wearable?
You can check an item's item definition index in TF2Items_OnGiveNamedItem.
|
Re: Get slot of tf_wearable?
Quote:
PHP Code:
|
Re: Get slot of tf_wearable?
Quote:
|
Re: Get slot of tf_wearable?
Quote:
GetEntPropEnt(wearable, Prop_Send, "m_iItemDefinitionIndex") returns -1 |
Re: Get slot of tf_wearable?
You almost had it! Use GetEntProp to get the integer value of the m_iItemDefinitionIndex netprop:
Code:
if(GetEntProp(wearable, Prop_Send, "m_iItemDefinitionIndex") == 1157) |
Re: Get slot of tf_wearable?
Quote:
Code:
PrintToServer("%d", GetEntProp(wearable, Prop_Send, "m_iItemDefinitionIndex")); |
All times are GMT -4. The time now is 21:55. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.