isPedInVehicle
Shared
Tells whether a ped or player is in a vehicle.
bool isPedInVehicle(ped ped)
Parameters
| Name | Type | Description |
|---|---|---|
| ped | ped | The ped or player. |
Returns
true if it is in a vehicle, false if not or if the element is not a ped.
Example
addCommandHandler("eject", function(player)
if isPedInVehicle(player) then
removePedFromVehicle(player)
end
end)