Skip to content

Player Library

Person8880 edited this page Dec 27, 2015 · 4 revisions

Overview

The player library provides functions for getting tables of players, or certain specific players.

Shine.GetAllClients

Shine.GetAllClients()

Returns an array of all currently connected server clients.

Shine.GetAllPlayers

Shine.GetAllPlayers()

Returns an array of all player entities (not server clients).

Shine.GetTeamClients

Shine.GetTeamClients( enum Team )

Returns an array of all server clients on the given team.

Shine.GetClientByID

Shine.GetClientByID( int ID )

Returns the server client with the given game ID (internal reference number, not the same as their server client ID) if one exists, otherwise nil.

Shine.GetClientByNS2ID

Shine.GetClientByNS2ID( int NS2ID )

Returns the server client with the given NS2 ID if one exists, otherwise nil.

Shine.GetClientBySteamID

Shine.GetClientBySteamID( string SteamID )

Returns the server client with the given Steam ID if one exists, otherwise nil.

Shine.GetClientByName

Shine.GetClientByName( string Name )

Returns the server client with the given name or a name that contains the given string if one exists, otherwise nil.

Shine:GetClient

Shine:GetClient( multiple ID )

Searches for a server client with a matching game ID, then NS2ID, then Steam ID and finally name. If one is matched from one of these filters, it will return the server client. If none match, it returns nil.

Shine:GetClientsByGroup

Shine:GetClientsByGroup( string GroupName )

Returns an array of all server clients in the given user group. Always returns a table, though it may be empty.

Shine:GetTeamName

Shine:GetTeamName( enum Team, boolean Capitals )

Returns a 'nice' string of the given team number's name. Capitals determines whether to use a capital letter at the start of the word.

Shine:GetClientsWithAccess

Shine:GetClientsWithAccess( string AccessFlag )

Returns a table of clients that have access to the given command, and the number of clients in the table.

Shine:GetClientsForLog

Shine:GetClientsForLog()

Returns a table of all clients that have log echo access, and the number of clients in the table.

Shine.GetClientInfo

Shine.GetClientInfo( ServerClient Client )

Returns a string formatted as "Name[NS2ID]", e.g "Bob[123456]". If passed nil, it returns "Console[N/A]".