Player.Spectate

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:Spectate( Enum )
Description:
Places player in spectator mode.
Returns: Enum
In Object: Player
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.Spectate]Player.Spectate [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionThis will make the player spectate the entity passed to the function.
Used onNewerServer.png
Code
function Spectate( ply, ent )
    ply:Spectate( OBS_MODE_CHASE )
    ply:SpectateEntity( ent )
end
OutputN/A


Arguments

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).

Additional Notes

See Also

Kdict.pngThis page needs reviewing. An expert needs to verify that all of the information in this page is correct.
See more articles for review here.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox