Garry's Mod Wiki

Revision Difference

GM:PlayerAuthed#562821

<function name="PlayerAuthed" parent="GM" type="hook"> <description> Called after the player is authenticated by Steam. This hook will also be called in singleplayer. See also <page>GM:NetworkIDValidated</page> Called after the player gets their <page>Player:UniqueID</page> set for the first time. This hook will also be called in singleplayer. See also <page>GM:NetworkIDValidated</page> <bug issue="3026"><page>Global.CurTime</page> returns 0 in this hook.</bug> <bug issue="5988">Calling <page>Player:UniqueID</page> before <page>GM:PlayerAuthed</page> causes <page>GM:PlayerAuthed</page> to be triggered prematurely. As a result, <page>Player:IsFullyAuthenticated</page> returns false when checked within this hook.</bug>⤶ </description> <realm>Server</realm> <args> <arg name="ply" type="Player">The player</arg> <arg name="steamid" type="string">The player's SteamID</arg> <arg name="uniqueid" type="string">The player's UniqueID</arg> </args> </function> <example> <code> hook.Add( "PlayerAuthed", "JoinNotification", function( ply, steamid, uniqueid ) print( ply:Name() .. " has been authenticated as " .. steamid .. "." ) end ) </code> <output> ``` Player1 has been authenticated as STEAM_0:1:12345678. ``` </output> </example>