OnPlayerPickUpPickup
From SA-MP Wiki
(Difference between revisions)
Revision as of 19:27, 19 February 2013 Smithy (Talk | contribs) (+ES) ← Previous diff |
Revision as of 00:36, 5 February 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
{{Scripting}} | {{Scripting}} | ||
- | {{Title}} | ||
{{Description|Called when a player picks up a pickup created with [[CreatePickup]].}} | {{Description|Called when a player picks up a pickup created with [[CreatePickup]].}} | ||
Line 7: | Line 6: | ||
{{Param|playerid|The ID of the player that picked up the pickup.}} | {{Param|playerid|The ID of the player that picked up the pickup.}} | ||
{{Param|pickupid|The ID of the pickup, returned by [[CreatePickup]].}} | {{Param|pickupid|The ID of the pickup, returned by [[CreatePickup]].}} | ||
+ | |||
{{NoReturn}} | {{NoReturn}} | ||
Line 41: | Line 41: | ||
[[es:OnPlayerPickUpPickup]] | [[es:OnPlayerPickUpPickup]] | ||
+ | [[fr:OnPlayerPickUpPickup]] |
Revision as of 00:36, 5 February 2014
Description:
Called when a player picks up a pickup created with CreatePickup.
(playerid,pickupid)
playerid | The ID of the player that picked up the pickup. |
pickupid | The ID of the pickup, returned by CreatePickup. |
Return Values:
This function does not return any specific values.
new pickup_Cash; new pickup_Health; public OnGameModeInit() { pickup_Cash = CreatePickup(1274, 2, 0.0, 0.0, 9.0); pickup_Health = CreatePickup(1240, 2, 0.0, 0.0, 9.0); return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { if(pickupid == pickup_Cash) { GivePlayerMoney(playerid, 1000); } else if(pickupid == pickup_Health) { SetPlayerHealth(playerid, 100); } 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.