Player::getVehicleIsTryingToEnter: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
(Added example.)
 
Line 6: Line 6:
*'''Vehicle handle or object'''
*'''Vehicle handle or object'''
==Example==
==Example==
<syntaxhighlight lang="javascript">
{{ClientsideCode|
// todo
<pre>
</syntaxhighlight>
const vehHandle = mp.players.local.getVehicleIsTryingToEnter();
if (vehHandle) {
    const veh = mp.vehicles.atHandle(vehHandle);
    if (veh) mp.gui.chat.push(`You are trying to enter vehicle model: ${veh.model}, with remote id: ${veh.remoteId}.`);
}
</pre>
}}
 
==See also==
==See also==
{{Player_function_c}}
{{Player_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 09:58, 27 August 2020

Syntax

player.getVehicleIsTryingToEnter();

Required Arguments

Return value

  • Vehicle handle or object

Example

Client-Side
const vehHandle = mp.players.local.getVehicleIsTryingToEnter();
if (vehHandle) {
    const veh = mp.vehicles.atHandle(vehHandle);
    if (veh) mp.gui.chat.push(`You are trying to enter vehicle model: ${veh.model}, with remote id: ${veh.remoteId}.`);
}

See also