Garry's Mod Wiki

player_info

Description

Called when a player's info has changed over the network.

Parameters

number friendsid
The Player:AccountID of the Player.
number index
The EntIndex of the Player minus one.
number bot
1 or 0 if it is a bot or not.
number userid
The UserID of the Player.
string name
The Name of the Player.
string networkid
The SteamID of the Player.

Examples

Example

This is a basic template with the purpose of including all arguments / table variables to make it easily known which values can be accessed.

gameevent.Listen( "player_info" ) hook.Add( "player_info", "player_info_example", function( data ) local name = data.name // Same as Player:Nick() local steamid = data.networkid // Same as Player:SteamID() local id = data.userid // Same as Player:UserID() local bot = data.bot // Same as Player:IsBot() local index = data.index // Same as Entity:EntIndex() minus one local friendsid = data.friendsid // Same as Player:AccountID() // Player has connected; this happens instantly after they join -- do something.. end )