Garry's Mod Wiki

player_changename

Description

Called when a player changes their Steam name.

Parameters

number userid
The UserID of the Player.
string oldname
The old Name.
string newname
The new Name.

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_changename" ) hook.Add( "player_changename", "player_changename_example", function( data ) local id = data.userid // Same as Player:UserID() for the speaker local oldname = data.oldname // The old Name of the Player local newname = data.newname // The new Name of the Player // Called when a player changes his Steam name. end )