CreatePickup

From SA-MP Wiki

Jump to: navigation, search

CreatePickup


This function does exactly the same as AddStaticPickup, except it returns a pickup ID which can be used to destroy it afterwards.


Parameters:
(model, type, Float:X, Float:Y, Float:Z, Virtualworld)
modelThe model of the pickup.
typeThe pickup spawn type.
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 of the pickup. Use -1 to make the pickup show in all worlds.


ReturnsThe ID of the created pickup.


new pickup; // Create a variable to store the pickup ID in
 
public OnGameModeInit()
{
    pickup = CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1);
    // Create an armour pickup and store the ID in 'pickup'
    return 1;
}
 
// Later..
DestroyPickup(pickup); // Example of using the pickup ID

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.

Personal tools
In other languages