Ped::isGettingIntoAVehicle

From RAGE Multiplayer Wiki
Revision as of 14:09, 3 November 2024 by Shr0x (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Client-Side
Function

 JavaScript



JavaScript Syntax


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.");
}


See also