M MY Multiplayer: Wiki
Side
Kind

removePedFromVehicle

Shared

Takes a ped or player out of its vehicle at once, with no animation.

bool removePedFromVehicle(ped ped)

Parameters

NameTypeDescription
pedpedThe ped or player. It also applies to the element's children.

Returns

true if the ped was taken out. false if it is not in a vehicle or getting into one.

If the ped was getting in, the entry is cancelled. The exit events fire; on the server, with forcedByScript set to true.

Example

addEventHandler("onVehicleEnter", root, function(ped, seat)
    if seat == 0 and getElementType(ped) == "ped" then
        removePedFromVehicle(ped)
    end
end)
NoteOn the client it only works with peds that client created; server elements raise an error.

See also