From Multi Theft Auto: Wiki
This function creates a pickup element, which is placed in the GTA world and can be picked up to retrieve a health, armour or a weapon.
- x: A floating point number representing the X coordinate on the map.
- y: A floating point number representing the Y coordinate on the map.
- z: A floating point number representing the Z coordinate on the map.
- theType: This is an integer representing the type of pickup, representing the following types:
- 0: Health Pickup
- 1: Armour Pickup
- 2: Weapon Pickup
- 3: Custom Pickup
- amount: This is an integer representing the amount of Health points or Armour points a pickup has.
- weapon: If the type is a Weapon pickup, then it represents the weapon ID of the weapon pickup. When used with the weapon pickup type set, the ammo parameter can be used.
- model: If the pickup is a custom model, this is the model id to use. Many non-pickup models can be used, though some may cause crashes. The following is a list of models designed to be used as pickups.
- 370: Jetpack
- 1212: Money (Wad of Cash)
- 1240: Health (heart)
- 1242: Armour
- 1272: House (blue)
- 1273: House (green)
- 1274: Money (dollar symbol)
- 1277: Save (floppy disk)
NOTE: When using optional arguments, you must supply all arguments before the one you wish to use. For more information on optional arguments, see Optional Arguments.
- respawnTime: How long before the pickup respawns in milliseconds
- ammo: An integer representing the amount of ammo a pickup contains. This is only valid when the pickup type is a weapon pickup.
This example creates a pickup after a player dies so that he drops his weapon.
function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) --when a player dies x, y, z = getElementPosition ( source ) --get the position of the person who died and define it as x, y and z currentweapon = getPlayerWeapon ( source ) --get the current weapon of the dead person createPickup ( x, y, z, 3, currentweapon, 10000, totalammo ) end addEventHandler ( "onPlayerWasted", getRootElement(), createDeathPickup ) --add an event handler for onPlayerWasted