SetPlayerSpectate

From Onset Developer Wiki
Revision as of 15:36, 19 November 2019 by 28days (talk | contribs)
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

Template:PlayerFunctions