- Documentation
- Server functions
- setPickupType
Function
setPickupType
Changes an existing pickup's type and contents without recreating it. amount and ammo mean the same as in createPickup.
Syntax
bool setPickupType(pickup thePickup, int theType [, int amount = 0, int ammo = 0])Arguments
thePickuppickup- The pickup.
theTypeint- 0 = health, 1 = armour, 2 = weapon, 3 = model.
amountint, optional = 0- Points, weapon ID or model ID.
ammoint, optional = 0- Ammo for a weapon.
Returns
true on success.
Example
local pickup = createPickup(0, 0, 3, 0, 100)
setPickupType(pickup, 2, 22, 34)
See also
createPickupCreates a pickup: a spinning item to collect - a health pack, body armour, a weapon or any model (e.g. a building entrance icon). A player collects it by walking into it; the server then firesonPickupHit(cancelEvent()there stops the collection), and the pickup hides forrespawnIntervaland comes back. The meaning ofamountdepends on the type: health or armour to add, a weapon ID, or a model ID.getPickupTypeReturns the pickup type: 0 health, 1 armour, 2 weapon, 3 custom model.