gta.createPickup

Revision as of 05:45, 14 January 2024 by Darkitxu84 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Function Server and Client icon-iii.png icon-vc.png icon-sa.png icon-iv.png Online and Offline

Available since Server 1.0.0, Client 1.0.0

Pickup gta.createPickup(int model, [ Vec3 position = Vec3(0.0,0.0,0.0) ], [ int pickupType = 2 ])

The gta.createPickup function is used to add a pickup, use the addToWorld function afterwards to add the pickup to the players games.

Parameters

1) int model The pickup model ID.
2) Vec3 position Optional, defaults to Vec3(0.0,0.0,0.0). The position for the pickup.
3) int pickupType Optional, defaults to 2. The pickup type.

Return

Pickup The pickup handle.

Notes

  • Please note that pickup type 0 is invalid.
  • List with pickup types can be found here (only for GTA3, GTA:VC and GTA:SA)
  • List with pickup models id can be found here: GTA3, GTA:VC, GTA:SA.

Examples

Example 1 - JavaScript:

const MODEL_ID = 431 // Craig Package Model in Vice City
const PICKUP_TYPE = 6 // PICKUP_COLLECTABLE1 in Vice City

addEventHandler("OnResourceStart", function(event, resource) {
gta.createPickup(MODEL_ID, Vec3(0.0,0.0,0.0), PICKUP_TYPE) //Create a pickup in cords X: 0.0, Y: 0.0, Z: 0.0

});

Compatibility

There isn't any compatibility information for this function.

Related

Server Related

        getPickupCount
        getPickups
        gta.createPickup


Client Related

      getPickupCount
      getPickups
  getWeaponPickupPrice
      gta.createPickup
  gta.enableHelpPickup
  gta.removeHelpPickup
  gta.removeHelpPickups
      setWeaponPickupPrice

        pickup.children
        pickup.clearExistsFor
      pickup.collected
        pickup.dimension
        pickup.existsFor
        pickup.getData
        pickup.getRotation
        pickup.id
        pickup.isCreatedFor
        pickup.isLocal
        pickup.isOwner
        pickup.isSyncer
        pickup.isType
      pickup.modelIndex
        pickup.name
        pickup.netFlags
        pickup.parent
      pickup.pickupType
        pickup.position
      pickup.quantity
        pickup.removeAllData
        pickup.removeData
        pickup.resource
        pickup.rotation
        pickup.setData
        pickup.setExistsFor
        pickup.setRotation
        pickup.setSyncer
      pickup.spawnTime
        pickup.streamInDistance
        pickup.streamOutDistance
        pickup.syncer
        pickup.syncerId
        pickup.type