Defines the Filter item (filter) of the Radiation plugin, a gas mask filter with an energy charge that is
swapped into the player's equipped gasmask item, or into the cp_filter character data for Civil Protection.
The filter that was in use is given back as a new filter item when it still has charge, and the item's description
shows the remaining charge.
Summary
Methods
Returns the filter's description with its remaining charge appended.
OnDrop(player, position)shared
Called when the filter is dropped; does nothing, so it can be dropped freely.
Swaps the filter into the player's gas mask, returning the old filter if it had charge left.
Methods
ITEM:GetClientSideDescription()
client gamemodes/cwhl2rp/plugins/containmentzones/plugin/items/sh_filter.lua:23Returns the filter's description with its remaining charge appended.
Returns
- String The description, or
falsewhen it is empty
ITEM:OnDrop(player, position)
shared gamemodes/cwhl2rp/plugins/containmentzones/plugin/items/sh_filter.lua:82Called when the filter is dropped; does nothing, so it can be dropped freely.
Parameters
- player
- position
ITEM:OnUse(player, itemEntity)
shared gamemodes/cwhl2rp/plugins/containmentzones/plugin/items/sh_filter.lua:41Swaps the filter into the player's gas mask, returning the old filter if it had charge left.
Civil Protection refill their cp_filter character data; other players need an equipped
gas mask, otherwise the filter is not used up.
Parameters
- player
- itemEntity
Returns
- Boolean
falsewhen the player has no equipped gas mask