Gamemode.PlayerSpawnedSENT

From GMod Wiki

Revision as of 05:00, 23 June 2010 by Crazy Quebecer (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NamePlayerSpawnedSENT
SyntaxGM:PlayerSpawnedSENT( Player Player, Entity Entity )
DescriptionCalled when a player has already spawned a Scripted Entity. Use this to record the SENT's propid. Useful for prop protection.
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerSpawnedSENT]Gamemode.PlayerSpawnedSENT [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionRecord the owner in the SENT's table.
Used onNewerServer.png
Code
 
function SpawnedSENT( userObj, propObj )
        propObj:GetTable().Owner = userObj
        userObj:GetTable().SENTs = userObj:GetTable().SENTs or {}
        table.insert( userObj:GetTable().SENTs, propObj )
end
 
hook.Add( "PlayerSpawnedSENT", "playerSpawnedSENT", SpawnedSENT );
OutputN/A


Additional Nos

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox