Garry's Mod Wiki

Garry's Mod Wiki

  boolean SANDBOX:PlayerGiveSWEP( Player ply, string weapon, table spawninfo )

Description

Called when a player attempts to give themselves a weapon from the Q menu. (Left mouse clicks on an icon)

Not to be confused with SANDBOX:PlayerSpawnSWEP, which is called when the weapon is spawned as entity on the ground.

Arguments

Returns

1 boolean
Can the SWEP be given to the player

Example

Stops non-admins from giving themselves weapons.

hook.Add( "PlayerGiveSWEP", "BlockPlayerSWEPs", function( ply, class, spawninfo ) if ( not ply:IsAdmin() ) then return false end end )

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...