OnPickupUse: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server event}} | {{Server event}} | ||
This event is triggered when a [[player]] stands on a [[pickup]] while not in a [[vehicle]]. | This event is triggered when a [[player]] stands on a [[pickup]] while not in a [[vehicle]]. | ||
Pickups use [[colshape]]s, you can get the [[colshape]] of the [[pickup]] with [[getElementColShape]] and use [[colshape]] [[event]]s to it | |||
Pickups use [[colshape]]s, you can get the [[colshape]] of the [[pickup]] with [[getElementColShape]] and use [[colshape]] [[event]]s to it. | |||
==Parameters== | ==Parameters== | ||
Line 9: | Line 10: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''playerWhoUsed''': A player element refering to the player who used the pickup | *'''playerWhoUsed''': A player element refering to the player who used the pickup. | ||
==Source== | ==Source== |
Revision as of 21:25, 2 April 2018
This event is triggered when a player stands on a pickup while not in a vehicle.
Pickups use colshapes, you can get the colshape of the pickup with getElementColShape and use colshape events to it.
Parameters
player playerWhoUsed
- playerWhoUsed: A player element refering to the player who used the pickup.
Source
The source of this event is the pickup that is getting used by the player.
Canceling
If this event is canceled, the player will not be given the item they picked up.
Example
This example announces whena player picks up a pickup
function pickupUse ( thePlayer ) outputChatBox ( getPlayerName ( thePlayer ) .. " picked up a pickup!" ) end addEventHandler ( "onPickupUse", getRootElement(), pickupUse )
See Also
Pickup events
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled