open.mp | AddStaticPickup
  • Home
  • FAQ
  • Forum
  • Servers
  • Docs
  • Blog
  • Login
  • Englishاللغة العربيةar-TNবাংলাbosanski jezikDeutschΕλληνικάEspañoleestiفارسیFrançaisHrvatskimagyarBahasa IndonesiaItaliano日本語ქართულიlietuvių kalbaNederlandsNorskjęzyk polskiPortuguêsRomânăРусскийslovenski jezikсрпски језикไทยWikang TagalogTürkçeУкраїнськаاردوTiếng Việt简体中文繁體中文
warning Not Translated

This page has not been translated into the language that your browser requested. The English content is being shown as a fallback.

If you want to contribute a translation for this page then please click here.

AddStaticPickup

Description

This function adds a 'static' pickup to the game. These pickups support weapons, health, armor etc., with the ability to function without scripting them (weapons/health/armor will be given automatically).

NameDescription
modelThe model of the pickup.
typeThe pickup type. Determines how the pickup responds when picked up.
Float:XThe X coordinate to create the pickup at.
Float:YThe Y coordinate to create the pickup at.
Float:ZThe Z coordinate to create the pickup at.
virtualworldThe virtual world ID to put tht pickup in. Use -1 to show the pickup in all worlds.

Returns

1 if the pickup is successfully created.

0 if failed to create.

Examples

public OnGameModeInit()
{
    // Create a pickup for armor
    AddStaticPickup(1242, 2, 1503.3359, 1432.3585, 10.1191, 0);

    // Create a pickup for some health, right next to the armour
    AddStaticPickup(1240, 2, 1506.3359, 1432.3585, 10.1191, 0);

    return 1;
}

Notes

tip

This function doesn't return a pickup ID that you can use in, for example, OnPlayerPickUpPickup. Use CreatePickup if you'd like to assign IDs.

Related Functions

  • CreatePickup: Create a pickup.
  • DestroyPickup: Destroy a pickup.
  • OnPlayerPickUpPickup: Called when a player picks up a pickup.

Community

  • Discord
  • Instagram
  • Twitter
  • Twitch
  • YouTube
  • Facebook
  • VK

More

  • SA-MP
  • Blog
  • GitHub