The player library is used to get the Lua objects that represent players in-game.
Player player.CreateNextBot( string botName )
Similar to the serverside command "bot", this function creates a new Player bot with the given name. This bot will not obey to the usual "bot_*" commands, and it's the same bot base used in TF2 and CS:S. The best way to control the behaviour of a Player bot right now is to use the GM:StartCommand hook and modify its input serverside. Despite this Player being fake, it has to be removed from the server by using Player:Kick and NOT Entity:Remove. Also keep in mind that these bots still u..
Gets all the current players in the server (not including connecting clients). This function returns bots as well as human players. See player.GetBots and player.GetHumans.This function returns sequential table, this means it should be looped with ipairs instead of pairs for efficiency reasons!
Player player.GetByID( number connectionID )
Gets the player with the specified connection ID. Connection ID can be retrieved via gameevent.Listen events. For a function that returns a player based on their Entity:EntIndex, see Entity. For a function that returns a player based on their Player:UserID, see Player.
Player player.GetByUniqueID( string uniqueID )
Gets the player with the specified uniqueID (not recommended way to identify players). It is highly recommended to use player.GetByAccountID, player.GetBySteamID or player.GetBySteamID64 instead as this function can have collisions ( be same for different people ) while SteamID is guaranteed to unique to each player.
Gives you the player count. Similar to #player.GetAll but with much better performance.