Garry's Mod Wiki

Revision Difference

GM:PlayerSpawnAsSpectator#511171

<function name="PlayerSpawnAsSpectator" parent="GM" type="hook">⤶ <ishook>yes</ishook>⤶ <description>Called to spawn the player as a spectator.</description>⤶ <realm>Server</realm>⤶ <predicted>No</predicted>⤶ <file line="232-246">gamemodes/base/gamemode/player.lua</file>⤶ <args>⤶ <arg name="ply" type="Player">The player to spawn as a spectator</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Makes all players spawn as spectators.</description>⤶ <code>⤶ function GM:PlayerSpawn( ply )⤶ ⤶ GAMEMODE:PlayerSpawnAsSpectator( ply )⤶ ⤶ end⤶ </code>⤶ ⤶ </example>