Gamemode.PlayerSpawnSWEP

From GMod Wiki

Revision as of 00:23, 23 March 2010 by Crazy Quebecer (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NamePlayerSpawnSWEP
SyntaxGM:PlayerSpawnSWEP( Player ply, String classname, Table weapon table )
DescriptionCalled when a player wants to spawn a SWEP
ReturnsBoolean
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerSpawnSWEP]Gamemode.PlayerSpawnSWEP [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionStops players spawning SWEPs.
Used onNewerServer.png
Code
function GM:PlayerSpawnSWEP( ply, class, wep )
	return false;
end
OutputN/A

DescriptionOnly allows admins to spawn SWEPs.
Used onNewerServer.png
Code
hook.Add("PlayerSpawnSWEP", "AdminOnlySWEPs", function( ply, class, wep )
	return ply:IsAdmin()
end)
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox