Garry's Mod Wiki


boolean SANDBOX:PlayerSpawnSWEP( Player ply, string weapon, table swep )


Called when a player attempts to spawn a weapon from the Q menu. ( Mouse wheel clicks on an icon )


1 Player ply
The player who attempted to spawn a weapon.
2 string weapon
Class name of the weapon the player tried to spawn.
3 table swep
Information about the weapon the player is trying to spawn, see Structures/SWEP


1 boolean
Can the SWEP be spawned


Stops non-admins from spawning weapons.

hook.Add( "PlayerSpawnSWEP", "SpawnBlockSWEP", function( ply, class, info ) if ( not ply:IsAdmin() ) then return false end end )

Page Links

Special Pages



Render Time: 33ms

Session 0
DB GetPage 3
Generate Html 14
SaveChanges 7
Render Body 0
Render Sidebar 6