Player.GetObserverMode
From GMod Wiki
Function | |
Syntax | Player:GetObserverMode( ) |
Description: | |
Get the player's observer (or "spectator") mode. | |
Returns: | Integer |
In Object: | Player |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Player.GetObserverMode]Player.GetObserverMode [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Description | Get the first player's observer mode. |
---|---|
Used on | |
Code | print( player.GetByID(1):GetObserverMode() ) |
Output | Will output 4 when the player is in first person spectate. |
Additional Notes
- This function is for getting the observer mode, if you wish to set the observer mode, use Player.Spectate
- Return Values:
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).