client
IsPedInAnyVehicle
FiveM client native documentation with a Lua example.
Summary
Returns whether a ped is currently in any vehicle. A quick boolean check used constantly in vehicle logic.
Returns
boolean
Parameters
pednumberThe ped.atGetInbooleanWhether to count peds entering (usually false).Example
if IsPedInAnyVehicle(PlayerPedId(), false) then
-- player is driving/riding
endCommon pitfalls
- Pass false for 'atGetIn' unless you specifically want the entering state.
- For the actual vehicle handle, use GetVehiclePedIsIn.
Related natives
Related guides
FiveM scripts done right
Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.
Browse Scripts →