Garry's Mod Wiki

Revision Difference

player_manager.SetPlayerClass#515779

<function name="SetPlayerClass" parent="player_manager" type="libraryfunc"> <description>Sets a player's class</description> <realm>Shared</realm> <args> <arg name="ply" type="Player">Player to set class</arg> <arg name="classname" type="string">Name of class to set</arg> </args> </function> <example> <description>⤶ Sets the player's class to 'player_default' every time they spawn⤶ <description>Sets the player's class to 'player_default' every time they spawn⤶ ``` ⤶ | Code =⤶ ```⤶ </description>⤶ <code>⤶ function GM:PlayerSpawn( ply ) ```⤶ ⤶ player_manager.SetPlayerClass(ply, "player_default")⤶ player_manager.SetPlayerClass(ply, "player_default")⤶ end⤶ </code>⤶ <output>⤶ ``` ⤶ end⤶ ```⤶ ⤶ | Output =⤶ ```⤶ ⤶ </description>⤶ </output>⤶ </example>