AddStaticPickup
Description:
Function AddStaticPickup adds a 'static' pickup to the game. These pickups support weapons, health, armor etc., with the ability to function without scripting them (weapons/health/armor will be given automatically).
This function doesn't return a pickup ID that you can use in, for example, OnPlayerPickUpPickup. Use CreatePickup if you'd like to assign IDs. |
Parameters:
(model, type, Float:X, Float:Y, Float:Z, virtualworld)
int | model | The model of the pickup. |
int | type | The pickup type. Determines how the pickup responds when picked up. |
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. |
int | virtualworld | The virtual world ID to put tht pickup in. Use -1 to show the pickup in all worlds. |
Return Values:
- 1: the pickup is successfully created.
- 0: failed to create.
Examples:
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 may be useful, as they are related to this function in one way or another.
- CreatePickup: Create a pickup.
- DestroyPickup: Destroy a pickup.
Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.
- OnPlayerPickUpPickup: Called when a player picks up a pickup.