- Documentation
- Shared functions
- getPickupType
Function
getPickupType
Returns the pickup type: 0 health, 1 armour, 2 weapon, 3 custom model.
Syntax
int getPickupType(pickup thePickup)Arguments
thePickuppickup- The pickup.
Returns
Type 0-3, or false.
Example
addEventHandler("onPickupHit", root, function(player)
if getPickupType(source) == 2 then
outputChatBox("Bron: " .. getWeaponNameFromID(getPickupWeapon(source)), player)
end
end)
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.setPickupTypeChanges an existing pickup's type and contents without recreating it.amountandammomean the same as increatePickup.