Observer turns noclip into an observer mode for staff: a noclipping player is invisible, not solid, invulnerable and hidden from everyone without the 'moderate' permission. Entering it requires the 'noclip' permission. A player who leaves observer mode is put back where they entered it if the observer_reset config is on; plugins can decide that per player through the ShouldObserverReset hook.

Summary

Hooks

Takes a player who dies in observer mode out of it, so that they do not respawn invisible and invulnerable.
Puts the player into observer mode: noclipping, invisible, not solid, invulnerable and hidden from players without the 'moderate' permission.
Takes the player out of observer mode and restores what was saved on entering it.
Registers the 'noclip' permission used by observer mode.
Keeps players where they are when leaving observer mode if the 'observer_reset' config is off.

Hooks

Observer:PlayerDeath(victim, _inflictor, _attacker)

server plugins/observer/plugin/sv_hooks.lua:100

Takes a player who dies in observer mode out of it, so that they do not respawn invisible and invulnerable. They are not moved back to where they entered it.

Parameters

  • victim Player
  • _inflictor Entity
  • _attacker Entity

Observer:PlayerEnterNoclip(actor)

shared plugins/observer/plugin/sv_hooks.lua:11

Implements hook PlayerEnterNoclip

On the server

Puts the player into observer mode: noclipping, invisible, not solid, invulnerable and hidden from players without the 'moderate' permission. The previous position, angles, color and move type are kept in actor.observer_data. Requires the 'noclip' permission.

Parameters

  • actor Player

Returns

  • Boolean always false, which blocks the default noclip

On the client

Blocks the default noclip clientside, since observer mode is handled by the server.

Parameters

  • _actor Player

Returns

  • Boolean always false

Defined in

Observer:PlayerExitNoclip(actor)

shared plugins/observer/plugin/sv_hooks.lua:51

Implements hook PlayerExitNoclip

On the server

Takes the player out of observer mode and restores what was saved on entering it. The player is moved back to where they started unless ShouldObserverReset said not to. The weapon is only drawn again when the player carries nothing, since the engine drops the carried object as soon as the weapon is drawn and draws the weapon by itself once the object is let go of. A vanished player stays hidden.

Parameters

  • actor Player

Returns

  • Boolean always false, which blocks the default noclip

On the client

Blocks the default noclip clientside, since observer mode is handled by the server.

Parameters

  • _actor Player

Returns

  • Boolean always false

Defined in

Observer:RegisterPermissions()

shared plugins/observer/plugin/sh_plugin.lua:13

Implements hook RegisterPermissions

Registers the 'noclip' permission used by observer mode.

Observer:ShouldObserverReset(_actor)

server plugins/observer/plugin/sv_hooks.lua:89

Implements hook ShouldObserverReset

Keeps players where they are when leaving observer mode if the 'observer_reset' config is off.

Parameters

  • _actor Player

Returns

  • Boolean false if the player should not be moved back, nil otherwise

Defined in