Ped::isGettingIntoAVehicle: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with " {{ClientsideJsFunction}} {{JSContainer| ===Required Params=== *'''ped:''' {{RageType|number}} ===Return value=== *''' {{RageType|boolean}} ''' ==Syntax== <syntaxhighlight lang="javascript"> mp.game.ped.isGettingIntoAVehicle(ped) </syntaxhighlight> ==Example== <syntaxhighlight lang="javascript"> //todo </syntaxhighlight> }} ==See also== {{Ped_s_function_c}} Category:Clientside API Category:TODO: Example")
 
No edit summary
 
Line 1: Line 1:
{{ClientsideJsFunction}}
{{ClientsideJsFunction}}
{{JSContainer|
{{JSContainer|


== 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===
=== Required Params ===
*'''ped:''' {{RageType|number}}
*'''ped:''' {{RageType|number}} - The pedestrian handle for which the entry status is being checked.


===Return value===
=== Return value ===
*''' {{RageType|boolean}} '''
*''' {{RageType|boolean}} ''' - Returns `true` if the ped is getting into a vehicle; otherwise, returns `false`.


==Syntax==
== Syntax ==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
mp.game.ped.isGettingIntoAVehicle(ped)
mp.game.ped.isGettingIntoAVehicle(ped)
</syntaxhighlight>
</syntaxhighlight>


==Example==
== Example ==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
//todo
// 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.");
}
</syntaxhighlight>
</syntaxhighlight>
}}
}}
==See also==
== See also ==
{{Ped_s_function_c}}
{{Ped_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 14:09, 3 November 2024

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