player_manager.RegisterClass

From Garry's Mod
Jump to: navigation, search
 player_manager.RegisterClass( )

Contents

Description

Register a class metatable to be assigned to players later

Arguments

string name

Class name

Arguments

table table

Class metatable

Arguments

string base

Base class name

Examples

Example

A quick look at registering a class table

local PLAYER = {}

PLAYER.DisplayName = "Default Class"

...

player_manager.RegisterClass( "player_default", PLAYER, nil )


Examples

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...
Personal tools
Navigation