OnClientPlayerPickupLeave: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Documented onClientPlayerPickupLeave)
 
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 5: Line 5:
==Parameters==
==Parameters==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
player thePickup, bool matchingDimension
pickup thePickup, bool matchingDimension
</syntaxhighlight>
</syntaxhighlight>
*'''thePickup:''' the pickup that was left.
*'''thePickup:''' the pickup that was left.
Line 16: Line 16:
This example outputs a message whenever the local player leaves a pickup.
This example outputs a message whenever the local player leaves a pickup.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local function clientPlayerPickupLeave(thePickup, matchingDimension)
function clientPlayerPickupLeave(thePickup, matchingDimension)
     outputChatBox("* You have left a pickup!", 255, 0, 0)
     outputChatBox("* You have left a pickup!", 255, 0, 0)
end
end
addEventHandler("onClientPlayerPickupLeave", localPlayer, clientPlayerPickupLeave)
addEventHandler("onClientPlayerPickupLeave", localPlayer, clientPlayerPickupLeave)
</syntaxhighlight>
</syntaxhighlight>
==Requirements==
{{Requirements|n/a|1.3.0-9.03919|}}


==See Also==
==See Also==

Latest revision as of 15:42, 3 October 2016

This event triggers whenever a player leaves pickup locally.

Parameters

pickup thePickup, bool matchingDimension
  • thePickup: the pickup that was left.
  • matchingDimension: true if thePickup is in the same dimension as the player, false otherwise.

Source

The source of this event is the player that left the pickup.

Example

This example outputs a message whenever the local player leaves a pickup.

function clientPlayerPickupLeave(thePickup, matchingDimension)
    outputChatBox("* You have left a pickup!", 255, 0, 0)
end
addEventHandler("onClientPlayerPickupLeave", localPlayer, clientPlayerPickupLeave)

Requirements

Minimum server version n/a
Minimum client version 1.3.0-9.03919

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.3.0-9.03919" />

See Also

Client pickup events


Client player events


Client event functions