ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. removePedFromVehicle

Function

removePedFromVehicle

ServerPedsIdentical to MTA:SA

Instantly takes a player or an NPC out of a vehicle and places them next to it, without the get-out animation. It fires onPlayerVehicleExit just like a normal exit and blocks the player from getting back in for 3 seconds so the game does not put them back. Returns false when the ped is not in a vehicle.

Syntax

bool removePedFromVehicle(ped ped)

Arguments

pedped
A player or an NPC.

Returns

true on success, false when the ped was on foot.

Example

addCommandHandler("wyrzuc", function(admin, _, name)
    local target = getPlayerFromName(name or "")
    if target and isPedInVehicle(target) then removePedFromVehicle(target) end
end)

See also