setPedExitVehicle | Multi Theft Auto: Wiki Skip to content

setPedExitVehicle

Client-side
Server-side
Shared

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 makes a ped exit a vehicle, similar to the enter_exit control state.

Note

This function only works on synced peds and vehicles (i.e. created server-side).

Syntax

setPedExitVehicle ( )

Code Examples

client

This example adds a command to make all synced peds exit their vehicles.

function exitPedVehicles()
-- For all streamed-in peds
for k,ped in ipairs(getElementsByType("ped", root, true)) do
-- Are we syncing it and is it in a vehicle
if isElementSyncer(ped) and isPedInVehicle(ped) then
setPedExitVehicle(ped)
end
end
end
addCommandHandler("getout", exitPedVehicles)

See Also