SetPlayerSpectate

From Onset Developer Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
SetPlayerSpectate

Type: Function
Context: Server
Introduced: v1.0

Description

Toggle the player spectate mode.

Syntax

SetPlayerSpectate(player, bSpectate)

Parameters

  • player
    The player identifier.
  • bSpectate
    The boolean status.

Return Value

  • This function returns nothing.

Example

function cmd_spec(player, disable)
	local _disable = false
	if disable ~= nil then
		_disable = true
	end
	_disable = not _disable
	SetPlayerSpectate(player, _disable)
end
AddCommand("spec", cmd_spec)

See also