USE Enumerations

From Garry's Mod
Jump to: navigation, search

Enumerations used by Entity:SetUseType. Affects when ENTITY:Use is triggered.

Not to be confused with USE_ Enums used for ENTITY:Use and others.

Warning! Decimal values are for reference only! The actual value may be different between two Garry's Mod versions.
Name Decimal Description
CONTINUOUS_USE 0 Fire a USE_ON signal every tick as long as the player holds their use key and aims at the target.
ONOFF_USE 1 Fires a USE_ON signal when starting to use an entity, and a USE_OFF signal when letting go.
WARNING

There is no guarantee to receive both ON and OFF signals. A signal will only be sent when pushing or letting go of the use key while actually aiming at the entity, so an ON signal might not be followed by an OFF signal if the player is aiming somewhere else when releasing the key, and similarly, an OFF signal may not be preceded by an ON signal if the player started aiming at the entity only after pressing the key.

Therefore, this method of input is unreliable and should not be used.

DIRECTIONAL_USE 2 Like a wheel turning.
SIMPLE_USE 3 Fire a USE_ON signal only once when player presses their use key while aiming at the target.
Personal tools
Navigation