AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [TF2] Weapon slot enum for GetPlayerWeaponSlot (https://forums.alliedmods.net/showthread.php?t=192118)

Powerlord 08-06-2012 13:07

[TF2] Weapon slot enum for GetPlayerWeaponSlot
 
As suggested by psychonic, I created an enum with a correct mapping of the TF2 weapon slots, based on empirical testing. It is intended to be used in place of the existing TFWeaponSlot values.

PHP Code:

enum
{
    
TFRealWeaponSlot_Primary,
    
TFRealWeaponSlot_Secondary,
    
TFRealWeaponSlot_Sapper 1,
    
TFRealWeaponSlot_Melee,
    
TFRealWeaponSlot_PDA,
    
TFRealWeaponSlot_BuildTool 3,
    
TFRealWeaponSlot_DisguiseKit 3,
    
TFRealWeaponSlot_PDA2,
    
TFRealWeaponSlot_DestroyTool 4,
    
TFRealWeaponSlot_CloakingDevice 4,
    
TFRealWeaponSlot_EngineerBuilder
}; 

As you can see, I included aliases for PDA and PDA2 to make them easier to use. Also note that a Spy's revolver is in the Primary slot despite being a secondary item in the schema.

EngineerBuilder is used by an invisible item with item index 28 that allows the Engineer to build his various buildings... the BuildTool and DestroyTool alone are not enough and will not work if the Engy doesn't have an item index 28.

Leonardo 08-08-2012 17:44

Re: [TF2] Weapon slot enum for GetPlayerWeaponSlot
 
Quote:

Originally Posted by Powerlord (Post 1765857)
an invisible item

nope. it's visible http://wiki.teamfortress.com/w/image...person_red.png

also
tf2itemsinfo's TF2ItemSlot enum wasn't enough?


All times are GMT -4. The time now is 18:30.

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