ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server events
  3. onPickupHit

Event

onPickupHit

A player walked into a pickup. You can block the pickup.

Handler

addEventHandler("onPickupHit", root, function(thePlayer, matchingDimension) ... end)

Parameters

thePlayerplayer
The player.
matchingDimensionbool
Whether in the same dimension.Not in MTA:SA

Differences from MTA:SA

  • Parameters in a different colour differ from MTA:SA.

In MTA:SA

function(player thePlayer)

Source

source is the pickup.

cancelEvent() blocks the pickup.

Example

addEventHandler("onPickupHit", root, function(player)
    if getPedOccupiedVehicle(player) then cancelEvent() end
end)

See also