Garry's Mod Wiki

player.GetByID

  Player player.GetByID( number connectionID )

Description

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.

Arguments

1 number connectionID
The connection ID to find the player by.

Returns

1 Player
Player if one is found, nil otherwise