SWEP.EquipAmmo

From GMod Wiki

Revision as of 15:16, 30 January 2011 by Cube334 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NameEquipAmmo
SyntaxSWEP:EquipAmmo( Player NewOwner )
DescriptionCalled when the NewOwner already has this weapon and instead gives only ammunition.
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=SWEP.EquipAmmo]SWEP.EquipAmmo [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]

Examples

DescriptionGive the owner health when ammo is picked up.
Used onNewerServer.png
Code
function SWEP:EquipAmmo( NewOwner )
	NewOwner:SetHealth(NewOwner:Health()+5)
end
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox