ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setPickupType

Function

setPickupType

ServerPickupsIdentical to MTA:SA

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