logic_eventlistener_itemequip

From Valve Developer Community
Jump to navigation Jump to search
Info.png
This entity is not in the Team Fortress 2 FGD by default.
See below for instructions on making it available.
Class hierarchy
CLogicEventListenerItemEquip
CLogicEventListener
CLogicalEntity
CServerOnlyEntity
CBaseEntity
logic_eventlistener.cpp

logic_eventlistener_itemequip is a point entity available in Half-Life 2: Deathmatch Half-Life 2: Deathmatch, Team Fortress 2 Team Fortress 2, and Counter-Strike: Global Offensive Counter-Strike: Global Offensive. An entity that can listen to the item_equip event fired from code and fire and output when it happens and the weapon class or type defined, match.

All event declarations can be found in these files:

resource/gameevents.res
resource/modeevents.res
resource/demoimportantevents.res
resource/serverevents.res
resource/hltvevents.res
resource/replayevents.res 

Keyvalues

Name (targetname) <string>
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Weapon Type (WeaponType) <integer choices>
  • -1 : "Don't care"
  • 0 : "Knife"
  • 1 : "Pistol"
  • 2 : "Submachinegun"
  • 3 : "Rifle"
  • 4 : "Shotgun"
  • 5 : "Sniper Rifle"
  • 6 : "Machinegun"
  • 7 : "C4"
  • 8 : "Grenade"
Weapon Classname (WeaponClassname) <string>
The exact weapon class name you want to check for. i.e. weapon_deagle, weapon_awp, weapon_knife, etc.
Start Enabled (IsEnabled) <boolean>
Team Number (TeamNum) <integer choices>
If set, will only fire its output if the event is generated from someone of the specified team.
  • -1 : "Don't care"
  • 1 : "Team 1"
  • 2 : "Team 2 (ORANGE)"
  • 3 : "Team 3 (BLUE)"

Inputs

Enable
Enable the logic_measure_movement.
Disable
Disable the logic_measure_movement.

Outputs

OnEventFired
Fired when the event has been detected.