Garry's Mod Wiki

player_activate

Description

Called when a player has entered the game (connected and loaded).
From this point you can use Player(userid) (serverside or in singleplayer)

This is called after GM:PlayerInitialSpawn so you could just use that hook serverside.

Members

number userid
The UserID 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_activate" ) hook.Add( "player_activate", "player_activate_example", function( data ) local id = data.userid // Same as Player:UserID() for the speaker // Called when a player is fully connected and loaded end )