M MY Multiplayer: Wiki
Side
Kind

isPedInVehicle

Shared

Tells whether a ped or player is in a vehicle.

bool isPedInVehicle(ped ped)

Parameters

NameTypeDescription
pedpedThe ped or player.

Returns

true if it is in a vehicle, false if not or if the element is not a ped.

Example

addCommandHandler("eject", function(player)
    if isPedInVehicle(player) then
        removePedFromVehicle(player)
    end
end)

See also