Gamemode.PlayerSpawnObject

From GMod Wiki

Revision as of 01:05, 26 July 2010 by Julio Gee (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NamePlayerSpawnObject
SyntaxGM:PlayerSpawnObject( Player ply )
DescriptionCalled when a player wants to spawn a prop, a ragdoll or an effect.
ReturnsBoolean
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerSpawnObject]Gamemode.PlayerSpawnObject [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionBlocks the spawning of objects for non admins.
Used onNewerServer.png
Code
 
local function AdminOnly( ply )
 
	return ply:IsAdmin()
 
end
hook.Add( "PlayerSpawnObject", "AdminOnly", AdminOnly)
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox