Skip to main content

Ped::isGettingIntoAVehicle

Client-side function

Description​

Checks if the specified pedestrian (ped) is currently in the process of entering a vehicle. This is useful for monitoring or controlling pedestrian behavior, particularly for actions involving vehicles, such as syncing animations or events related to vehicle entry.

Required Params​

  • ped: number - The pedestrian handle for which the entry status is being checked.

Return value​

  • boolean - Returns true if the ped is getting into a vehicle; otherwise, returns false.

Syntax​

mp.game.ped.isGettingIntoAVehicle(ped)

Example​

// Check if a pedestrian is entering a vehicle
const ped = mp.players.local.handle;
if (mp.game.ped.isGettingIntoAVehicle(ped)) {
mp.gui.chat.push("Player is getting into a vehicle.");
} else {
mp.gui.chat.push("Player is not entering a vehicle.");
}