Garry's Mod Wiki

player.GetAll

table player.GetAll()

Description

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.

Returns

1 table
All Players currently in the server.

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]

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

Page Links


Special Pages


Wikis

?

Render Time: 22ms

Session 0
DB GetPage 4
Generate Html 1
SaveChanges 8
Render Body 0
Render Sidebar 6