Garry's Mod Wiki

player_manager.RegisterClass

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

Description

Register a class metatable to be assigned to players later

Arguments

1 string name
Class name
2 table table
Class metatable
3 string base
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...

Page Links


Special Pages


Wikis

?

Render Time: 46ms

DB GetPage 4
Generate Html 11
SaveChanges (1) 10
Render Body 0
Render Sidebar 17