AddStaticPickup

From SA-MP Wiki

Jump to: navigation, search

Contents

AddStaticPickup


This function adds an object to the game in a pickupable form.


Parameters:
(model,type,Float:X,Float:Y,Float:Z,Virtualworld)
modelThe model ID you'd like for the pickup.
typeThe pickup spawn type, see further down this page.
Float:XThe X-coordinate for the pickup to show.
Float:YThe Y-coordinate for the pickup to show.
Float:ZThe Z-coordinate for the pickup to show.
virtualworldThe virtual world ID of the pickup. A value of -1 will cause the pickup to display in all virtual worlds.


ReturnsTrue if the pickup is successfully created.


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;
}

Related Functions

The following functions might be useful as well, as they're related to this function in one way or another.


Related Callbacks

The following callbacks might be useful, as they're related to this function in one way or another.


Available Pickup Types

 0
The pickup does not display.

 1
Not pickupable, exists all the time.

 2
Pickupable, respawns after some time.

 3
Pickupable, respawns after death

 4
Disappears shortly after created (perhaps for weapon drops?)

 5
Disappears shortly after created (perhaps for weapon drops?)

 8
Pickupable, but has no effect. Disappears automatically.

 11
Blows up a few seconds after being created (bombs?)

 12
Blows up a few seconds after being created.

 13
Slowly decends to the ground.

 14
Pickupable, but only when in a vehicle. Falls through objects made with CreateObject, etc.

 15
Pickupable, respawns after death

 19
Pickupable, but has no effect (information icons?)

 22
Pickupable, respawns after death.

 23
Pickupable, but doesn't disappear on pickup.

Personal tools
In other languages