SetPlayerSpectate: Difference between revisions

From Onset Developer Wiki
28days (talk | contribs)
No edit summary
No edit summary
 
Line 25: Line 25:


{{RelatedFunctions}}
{{RelatedFunctions}}
{{Template:PlayerFunctions}}
{{ServerPlayerFunctions}}

Latest revision as of 14:50, 26 June 2021

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