CreatePickup
From SA-MP Wiki
(Difference between revisions)
Revision as of 01:05, 5 February 2014 Connor Mead (Talk | contribs) ← Previous diff |
Revision as of 01:06, 5 February 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 44: | Line 44: | ||
[[de:CreatePickup]] | [[de:CreatePickup]] | ||
- | [(fr:CreatePickup]] | + | [[fr:CreatePickup]] |
[[ru:CreatePickup]] | [[ru:CreatePickup]] |
Revision as of 01:06, 5 February 2014
Description:
This function does exactly the same as AddStaticPickup, except it returns a pickup ID which can be used to destroy it afterwards and be tracked using OnPlayerPickUpPickup.
(model, type, Float:X, Float:Y, Float:Z, Virtualworld)
model | The model of the pickup. |
type | The pickup spawn type. |
Float:X | The X coordinate to create the pickup at. |
Float:Y | The Y coordinate to create the pickup at. |
Float:Z | The Z coordinate to create the pickup at. |
virtualworld | The virtual world ID of the pickup. Use -1 to make the pickup show in all worlds. |
Return Values:
The ID of the created pickup, -1 on failure (pickup max limit).
Note |
|
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 may be useful, as they are related to this function in one way or another.
- AddStaticPickup: Add a static pickup.
- DestroyPickup: Destroy a pickup.
Related Callbacks
The following callbacks might be useful, as they're related to this function in one way or another.
- OnPlayerPickUpPickup: Called when a player picks up a pickup.