warpPedIntoVehicle | Multi Theft Auto: Wiki Skip to content

warpPedIntoVehicle

Client-side
Server-side
Shared

Pair: getPedOccupiedVehicle

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function is used to warp or force a ped into a vehicle. There are no animations involved when this happens.

Important

If you used setElementPosition to spawn the ped / player , this function will not work and returns false .

Syntax

warpPedIntoVehicle ( )

Code Examples

server

This example creates a vehicle and warps a ped inside immediately.

function setupForRace ( )
local RacerPed = createPed ( 252, 0, 0, 3 )
local RaceVehicle = createVehicle ( 411, 4, 0, 3 ) -- create a vehicle.
warpPedIntoVehicle ( RacerPed, RaceVehicle ) -- warp the ped straight into the vehicle
end
addCommandHandler ( "startrace", setupForRace ) -- add a command to start race

Issues

ID Description
475 Network trouble when calling warpPedIntoVehicle on resourceStart

See Also