player/GetByID

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Created page with "{{Func |Name=GetByID |Parent=player |Description=Gets the player with the specified connection ID. |Realm=Shared |IsClass=No }} {{Arg |type=number |name=connectionID ...")
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Func
 
{{Func
|Name=GetByID
 
|Parent=player
 
 
|Description=Gets the player with the specified connection ID.
 
|Description=Gets the player with the specified connection ID.
 +
 +
Connection ID can be retrieved via {{LibraryFunction|gameevent|Listen}} events.
 +
 +
For a function that returns a player based on their {{ClassFunction|Entity|EntIndex}}, see {{GlobalFunction|Entity}}.<br/>
 +
For a function that returns a player based on their {{ClassFunction|Player|UserID}}, see {{GlobalFunction|Player}}.
 
|Realm=Shared
 
|Realm=Shared
 
|IsClass=No
 
|IsClass=No
 +
|Name=GetByID
 +
|Parent=player
 
}}
 
}}
 
{{Arg
 
{{Arg
Line 12: Line 17:
 
}}
 
}}
 
{{Ret
 
{{Ret
|type=Player or nil
+
|type=Player
|desc= ply
+
|desc=Player if one is found, nil otherwise
 
}}
 
}}

Latest revision as of 02:46, 15 August 2015

 player.GetByID( )

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

number connectionID

The connection ID to find the player by.

Returns

Player

Player if one is found, nil otherwise
Personal tools
Navigation