Garry's Mod Wiki


  GM:PlayerDroppedWeapon( Player owner, Weapon wep )


Called when a weapon is dropped by a player via Player:DropWeapon.

Also called when a weapon is removed from a player via Player:StripWeapon.

See also GM:WeaponEquip for a hook when a player picks up a weapon.

The weapon's Entity:GetOwner will be NULL at the time this hook is called.

WEAPON:OnDrop will be called before this hook is.


1 Player owner
The player who owned this weapon before it was dropped
2 Weapon wep
The weapon that was dropped


Print in the chat when a player drop his weapons

hook.Add("PlayerDroppedWeapon", "PrintWhenDrop", function(owner, wep) PrintMessage(HUD_PRINTTALK, owner:Nick() .. " drop " .. wep:GetPrintName()) end)
Output: Player1 drop AR2