Global/Player

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Added the returned value)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function
+
{{Func
| Name = Player
+
|Description=Returns the player with the matching {{ClassFunction|Player|UserID}}.
| Namespace = [[Global]]
+
| Realm = Shared
+
}}
+
  
{{Syntax
+
For a function that returns a player based on their {{ClassFunction|Entity|EntIndex}}, see {{GlobalFunction|Entity}}.<br/>
| Name = Player
+
For a function that returns a player based on their connection ID, see {{LibraryFunction|player|GetByID}}.<br/>
| Description = Returns the player with the matching player index.
+
|Realm=Shared
| Returns = {{Return|Player|ply}}
+
|IsClass=No
 
+
}}
| Arg1Name = playerIndex
+
{{Arg
| Arg1Type = number
+
|type=number
| Arg1Req = false
+
|name=playerIndex
| Arg1Desc = The player index.
+
|desc=The player index.
| Arg1Default = -1
+
}}
 +
{{Ret
 +
|type=Player
 +
|desc=The retrieved player.
 
}}
 
}}

Latest revision as of 05:36, 4 November 2016

 Player( )

Description

Returns the player with the matching Player:UserID.

For a function that returns a player based on their Entity:EntIndex, see Entity.
For a function that returns a player based on their connection ID, see player.GetByID.

Arguments

number playerIndex

The player index.

Returns

Player

The retrieved player.
Personal tools
Navigation