player.GetByUniqueID
From GMod Wiki
| Function | |
| Syntax |
player.GetByUniqueID( String uniqueid ) Where is this used? |
| Description: | |
| Retrieve a player object based upon his UniqueID | |
| Returns: | Player object if found, false if not found. |
| Part of Library: | Player |
| Realm: |
|
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Player.GetByUniqueID]Player.GetByUniqueID [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
| Description | This example tries to find a player whose uniqueid is 21. |
|---|---|
| Used on | |
| Code | local pl = player.GetByUniqueID("21") if pl then pl:PrintMessage(3, "Hello.") end |
| Output | N/A |
Additional Notes
- This will return false if no player is found.
- This can NOT be found by using the status command (Is not player's User ID/Entity Index)
- you can get a player's unique ID using Player.UniqueID