AddStaticPickup2

From SA-MP Wiki

Jump to: navigation, search


AddStaticPickup2

This function can be used in case you want to add pickups to your gamemode. Pickups can be pretty much any object that GTA: San Andreas supports, from palm trees to health- and armour icons. You can define the way a pickup should act by the type parameter. Please look at CreatePickup2 for pickups which you can destroy afterwards. Furthermore it save the parameters models, types and pickup positions, what is essential for OnPlayerPickupItem.

It strongly recommend to use AddStaticPickup2 instead of AddStaticPickup!


Parameters:
(model, type, Float:X, Float:Y, Float:Z)
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


ReturnsThe ID of the pickup which was just created
Returns0 if none was created (e.g.: reached the limit of pickups)


public OnGameModeInit( )
{
    // Create a pickup for armor
    AddStaticPickup2(1242, 2, 1503.3359, 1432.3585, 10.1191);
 
    // Create a pickup for some health, right next to the armour
    AddStaticPickup2(1240, 2, 1506.3359, 1432.3585, 10.1191);
 
    return 1;
}
Personal tools