Garry's Mod Wiki

GM:PreRegisterSENT

  boolean GM:PreRegisterSENT( table ent, string class )

Description

Arguments

1 table ent
The entity table to be registered.
2 string class
The class name to be assigned.

Returns

1 boolean
Return false to prevent the entity from being registered. Returning any other value has no effect.

Example

Disallow registration of entities created by Garry, and change admin-only entities into regular entities.

hook.Add( "PreRegisterSENT", "MakeThingsFun", function( ent, class ) if ( ent.Author == "Garry Newman" ) then return false end ent.AdminOnly = false end )