Ammo Base item
Item defined in core/items/sh_ammo_base.lua
Defines the ammo_base base item for ammunition: using one gives ammoAmount rounds of ammoClass if the player
carries a weapon that takes that ammo.
Each instance has a networked Rounds data field, and the item's weight and space scale with the rounds left.
Summary
Methods
ammoAmount.ammoAmount.Rounds data from the item's ammoCount field.ammoAmount rounds of ammoClass if the player carries a weapon that uses it, consuming the item.Methods
Returns the tooltip line showing how many rounds the item holds.
Returns
- String Markup line with
roundsTextandammoAmount
Returns the item's inventory space scaled by the rounds left out of ammoAmount.
Returns
- Number The space taken by the remaining rounds
Returns the item's weight scaled by the rounds left out of ammoAmount.
Returns
- Number The weight of the remaining rounds
Called when a player drops the ammo; does nothing, so dropping is allowed.
Parameters
- player
- position
Sets the new instance's Rounds data from the item's ammoCount field.
Gives ammoAmount rounds of ammoClass if the player carries a weapon that uses it, consuming the item.
Parameters
- player
- itemEntity
Returns
- Boolean
false(keeping the item) when no carried weapon uses this ammo, otherwisenil