Player.UserID
From GMod Wiki
Function | |
Syntax | Player:UserID( ) |
Description: | |
This function returns the User ID of a player. | |
Returns: | Integer |
In Object: | Player |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Player.UserID]Player.UserID [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | This function returns the User ID of a player |
---|---|
Used on | |
Code | print(ply:UserID( )) |
Output | Returns UserID in the console. |
Additional Notes
- The User ID is not the entity index of the player (IE - Player 1, Player 2, etc) - the User ID is increased by one for each player who joins. It's used more as a temporary multiplayer ID number.
- Using the SteamID or UniqueID would be better in most cases.