GM/InitPostEntity

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Added information about PVS)
Line 1: Line 1:
 
{{Hook
 
{{Hook
 +
|Description=Called after all the entities are initialized.
 +
'''Note:''' At this point the client only knows about the entities that are within the spawnpoints PVS.
 +
For instance, if the server sends an entity that is not within this PVS, the client will receive it as NULL entity.
 +
|Realm=Shared
 +
|Predicted=No
 
|Name=InitPostEntity
 
|Name=InitPostEntity
 
|Parent=GM
 
|Parent=GM
|Description=Called after all the entities are initialized.
 
|Realm=Shared
 
 
}}
 
}}
 
{{Example
 
{{Example
Line 17: Line 20:
 
print("Initialization hook called")
 
print("Initialization hook called")
 
end )
 
end )
 
 
|Output=All Entities have initialized<br/>
 
|Output=All Entities have initialized<br/>
 
Initializtion hook called
 
Initializtion hook called
 
}}
 
}}

Revision as of 01:02, 23 July 2015

 GM:InitPostEntity( )

Description

Called after all the entities are initialized. Note: At this point the client only knows about the entities that are within the spawnpoints PVS. For instance, if the server sends an entity that is not within this PVS, the client will receive it as NULL entity.

Examples

Example

Some message will be printed in the console when the entities initialize.

function GM:InitPostEntity()
	print("All Entities have initialized\n" )
end

-- That way you are overriding the default hook
-- you can use hook.Add to make more functions get called when this event occurs

hook.Add( "InitPostEntity", "some_unique_name", function()
	print("Initialization hook called")
end )

Output:

All Entities have initialized
Initializtion hook called
Personal tools
Navigation