Garry's Mod Wiki

player_manager.RegisterClass

  player_manager.RegisterClass( string name, table table, string base = nil )

Description

Register a class metatable to be assigned to players later.

Arguments

1 string name
Class name.
2 table table
Class metatable, see PLAYER structure.
3 string base = nil
Base class name.

Example

A quick look at registering a class table.

local PLAYER = {} PLAYER.DisplayName = "Default Class" -- ... player_manager.RegisterClass( "player_default", PLAYER, nil )

Example

You can retrieve the data you've set when registering the table using baseclass.Get( "<classname>" ).

PrintTable( baseclass.Get( "player_default" ) )
Output:
Walkspeed = 300 RunSpeed = 500 CalcView = function: 0x00665988 UseVMHands = true --- etc...