Player.GetObserverMode

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:GetObserverMode( )
Description:
Get the player's observer (or "spectator") mode.
Returns: Integer
In Object: Player
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.GetObserverMode]Player.GetObserverMode [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionGet the first player's observer mode.
Used onNewerShared.png
Code
print( player.GetByID(1):GetObserverMode() )
OutputWill output 4 when the player is in first person spectate.


Additional Notes

SHARED | 0000000000000000 | 00000000000000000 | OBS_MODE_NONE -- Not in spectator mode.
SHARED | 0000000000000001 | 00000000000000001 | OBS_MODE_DEATHCAM -- Special mode for death cam animation.
SHARED | 0000000000000002 | 00000000000000010 | OBS_MODE_FREEZECAM -- View is frozen to a specific frame.
SHARED | 0000000000000003 | 00000000000000011 | OBS_MODE_FIXED -- View from a fixed camera position.
SHARED | 0000000000000004 | 00000000000000100 | OBS_MODE_IN_EYE -- Follow a player in first person view.
SHARED | 0000000000000005 | 00000000000000101 | OBS_MODE_CHASE -- Follow an entity in third person view.
SHARED | 0000000000000006 | 00000000000000110 | OBS_MODE_ROAMING -- Free roaming (glorified noclip).
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox