Garry's Mod Wiki

Garry's Mod Wiki

  table list.Get( string identifier )

Description

Returns a copy of the list stored at identifier.

This function uses table.Copy which can be very slow for larger lists. You should avoid calling it repeatedly or in performance sensitive hooks such as GM:Think.

Where possible you should use the much faster helper functions: list.Contains, list.HasEntry, or list.GetEntry.

There is also the more dangerous option of calling list.GetForEdit to get the unprotected list if you absolutely must iterate through it in a think hook.

Arguments

1 string identifier
The list identifier.

Returns

1 table
The copy of the list.

Example

Get every available NPC from the client:

PrintTable( list.Get( "NPC" ) )

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...