AddStaticPickup2
From SA-MP Wiki
[edit]
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!
It strongly recommend to use AddStaticPickup2 instead of AddStaticPickup!
(model, type, Float:X, Float:Y, Float:Z)
| model | The model ID you'd like for the pickup |
| type | The pickup spawn type, see further down this page |
| Float:X | The X-coordinate for the pickup to show |
| Float:Y | The Y-coordinate for the pickup to show |
| Float:Z | The Z-coordinate for the pickup to show |
| Returns | The ID of the pickup which was just created |
| Returns | 0 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; }
