player.GetAll

From Garry's Mod
Jump to: navigation, search
 player.GetAll( )

Contents

Description

Gets all the current players in the server (not including connecting clients).

NOTE

This function returns bots as well as human players. See player.GetBots and player.GetHumans.

Returns

table

All Players currently in the server.

Examples

Example

Prints all the players currently in the server.

PrintTable( player.GetAll() )

Output:

1 = [Player][1][Player1]
2 = [Player][2][Bot01]
3 = [Player][3][Bot02]

Examples

Example

Prints the number of players in the server. The same output can be achieved more efficiently with player.GetCount.

print(#player.GetAll())

Output:

3
Personal tools
Navigation