GM/PlayerAuthed

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Output of the example did not match the example code.)
(commands? what commands?)
Line 1: Line 1:
 
{{Hook
 
{{Hook
|Name=PlayerAuthed
+
|Description=Called once when the player is authenticated.
|Parent=GM
+
|Description=Commands to run once a player is authenticated.
+
 
|Realm=Server
 
|Realm=Server
 
|Predicted=No
 
|Predicted=No
 +
|Name=PlayerAuthed
 +
|Parent=GM
 
}}
 
}}
 
{{Arg
 
{{Arg
Line 14: Line 14:
 
|type=string
 
|type=string
 
|name=steamid
 
|name=steamid
|desc=The player's steam id
+
|desc=The player's SteamID
 
}}
 
}}
 
{{Arg
 
{{Arg
 
|type=string
 
|type=string
 
|name=uniqueid
 
|name=uniqueid
|desc=The player's unique id
+
|desc=The player's UniqueID
 
}}
 
}}
 
{{Example
 
{{Example
 
|Code=function GM:PlayerAuthed( ply, steamid, uniqueid )
 
|Code=function GM:PlayerAuthed( ply, steamid, uniqueid )
     print( ply:Name().." has been authenticated as "..steamid.."." )
+
     print( ply:Name() .. " has been authenticated as " .. steamid .. "." )
 
end
 
end
 
|Output=If a person with the name "Garry :D" and SteamID "STEAM_0:1:12345678" joins the game, once authenticated, console will print out "Garry :D has been authenticated as STEAM_0:1:12345678."
 
|Output=If a person with the name "Garry :D" and SteamID "STEAM_0:1:12345678" joins the game, once authenticated, console will print out "Garry :D has been authenticated as STEAM_0:1:12345678."
 
}}
 
}}

Revision as of 17:25, 28 February 2016

 GM:PlayerAuthed( )

Contents

Description

Called once when the player is authenticated.

Arguments

Player ply

The player

Arguments

string steamid

The player's SteamID

Arguments

string uniqueid

The player's UniqueID

Examples

Example

function GM:PlayerAuthed( ply, steamid, uniqueid )
    print( ply:Name() .. " has been authenticated as " .. steamid .. "." )
end

Output:

If a person with the name "Garry :D" and SteamID "STEAM_0:1:12345678" joins the game, once authenticated, console will print out "Garry :D has been authenticated as STEAM_0:1:12345678."
Personal tools
Navigation