Garry's Mod Wiki

Add_NPC_Class

  Add_NPC_Class( string name )

Description

Defines a global entity class variable with an automatic value. In order to prevent collisions with other CLASS enum. You should prefix your variable with CLASS_ for consistency.

Arguments

1 string name
The name of the new enum/global variable.

Example

Creates a global variable named CLASS_TESTER and prints its value.

Add_NPC_Class( "CLASS_TESTER" ) print( CLASS_TESTER )
Output: 36 (one greater than the current highest value of the CLASS enum)