warpPedIntoVehicle
Shared
Puts a ped or player straight into a vehicle seat, with no animation.
bool warpPedIntoVehicle(ped ped, vehicle vehicle [, int seat = 0])
Parameters
| Name | Type | Description |
|---|---|---|
| ped | ped | The ped or player. |
| vehicle | vehicle | The vehicle. |
| seat | int | The seat: 0 is the driver, 1 and up the passengers.default 0 |
Returns
true if the ped was put in. false if the seat does not exist, the ped is dead, the vehicle is wrecked or, on the server, whoever holds the seat is getting in or out.
Whoever was in the seat is removed first. The enter events fire as if the ped had got in. On the server, putting someone in the driver's seat turns the engine on.
Example
addCommandHandler("car", function(player)
local vehicle = createVehicle("infernus", 2495.0, -1680.0, 13.4)
warpPedIntoVehicle(player, vehicle)
end)NoteOn the client it only works with peds and vehicles that client created; server elements raise an error.