Garry's Mod Wiki

OnRequestFullUpdate

Description

Called when a player requests a full update from the server. Called Clientside when the Update is received.

When this event is called net messages will be reliably received by the client.

Parameters

string networkid
The SteamID the player has. Will be BOT for bots and STEAM_0:0:0 in single-player.
string name
The name the player has.
number userid
The UserID the player has.
number index
The EntIndex of the player, minus one.

Examples

Example

Early Networking Example

local pending_players = {} hook.Add( "PlayerInitialSpawn", "EarlyNetworking_Example", function( ply ) pending_players[ ply:UserID() ] = true end ) gameevent.Listen( "OnRequestFullUpdate" ) hook.Add( "OnRequestFullUpdate", "OnRequestFullUpdate_example", function( data ) local index = data.index // Same as Entity:EntIndex() minus one pending_players[ index ] = nil // Some networking here end )

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( "OnRequestFullUpdate" ) hook.Add( "OnRequestFullUpdate", "OnRequestFullUpdate_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 index = data.index // Same as Entity:EntIndex() minus one // Called when a player requests a full update from the server. end )