OnPickupUse: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (Edited language change)
 
Line 27: Line 27:


{{See also/Server event|Pickup events}}
{{See also/Server event|Pickup events}}
[[ru:onPickupUse]]

Latest revision as of 12:13, 8 June 2022

This event is triggered when a player stands on a pickup while not in a vehicle.

[[{{{image}}}|link=|]] Tip: 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 referring 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 outputs a message to the chatbox when a player uses a pickup.

function pickupUse( thePlayer )
    outputChatBox( getPlayerName( thePlayer ) .. " used a pickup!" )
end
addEventHandler( "onPickupUse", root, pickupUse )

See Also

Pickup events


Event functions