Gamemode.PlayerSpawnProp

From GMod Wiki

Revision as of 17:39, 18 November 2009 by Dlaor (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NamePlayerSpawnProp
SyntaxGM:PlayerSpawnProp( Player ply, String mdl )
DescriptionCalled when a player spawns a prop
ReturnsBoolean
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerSpawnProp]Gamemode.PlayerSpawnProp [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionBlocks the spawning of props in the models table.
Used onNewerServer.png
Code
local models = { "crane_frame.mdl" } --All or part of model name.
local function blockProps( ply, mdl )
	for _, v in pairs( models ) do
		if string.find( mdl, v ) then
			return false
		end
	end
end
hook.Add( "PlayerSpawnProp", "blockProps", blockProps )
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox