- Documentation
- Server functions
- setPedExitVehicle
Function
setPedExitVehicle
Takes a ped out of its vehicle on the server, records its "exit vehicle" task and sends every client the onClientPedExitRequest event (ped, vehicle). The exit works like removePedFromVehicle, i.e. instantly, without the door animation. Returns false when the ped is not in a vehicle.
Syntax
bool setPedExitVehicle(ped ped)Arguments
pedped- A player or an NPC.
Returns
true on success.
Example
addCommandHandler("wysiadka", function(player)
setPedExitVehicle(player)
end)
See also
removePedFromVehicleInstantly takes a player or an NPC out of a vehicle and places them next to it, without the get-out animation. It firesonPlayerVehicleExitjust like a normal exit and blocks the player from getting back in for 3 seconds so the game does not put them back. Returnsfalsewhen the ped is not in a vehicle.setPedEnterVehicleTells a ped to get into a vehicle the normal way, walking up and playing the door animation. On the client it only works for the local player: the player walks to a vehicle within 10 m and gets in (other peds givefalse). On the server it records the ped's task and sends every client theonClientPedEnterRequestevent (ped, vehicle, seat), which a client script can handle; the ped itself does not walk up yet on the server.