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: <br>Walkspeed = 300<br> RunSpeed = 500<br> CalcView = function: 0x00665988<br> UseVMHands = true<br> etc...

Page Links


Special Pages


Wikis

?

Render Time: 32ms

Session 0
DB GetPage 3
Generate Html 7
SaveChanges 8
Render Body 0
Render Sidebar 11