Garry's Mod Wiki

player_manager.SetPlayerClass

  player_manager.SetPlayerClass( Player ply, string className )

Description

Sets a player's class

Arguments

1 Player ply
Player to set class
2 string className
Name of class to set

Example

Sets the player's class to 'player_default' every time they spawn

function GM:PlayerSpawn( ply ) player_manager.SetPlayerClass(ply, "player_default") end