M MY Multiplayer: Wiki
Side
Kind

getPedContactElement

Client

Returns the vehicle or object a ped is standing on.

vehicle|object|false getPedContactElement(ped thePed)

Parameters

NameTypeDescription
thePedpedThe ped or player.

Returns

The vehicle or object, or false if the ped is on the map's ground, on a building, in the air or cannot be read.

Example

addEventHandler("onClientRender", root, function()
    local contact = getPedContactElement(localPlayer)
    if contact and getElementType(contact) == "vehicle" then
        dxDrawText("On top of a vehicle", 20, 300)
    end
end)

See also