Vehicle::isAConvertible: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
Line 1: Line 1:
p1 is false almost always.<br><br>However, in launcher_carwash/carwash1/carwash2 scripts, p1 is true and is accompanied by DOES_VEHICLE_HAVE_ROOF
{{ClientsideJsFunction}}
{{JSContainer|
Returns whether given vehicle has a converitble roof and an animation to lower/raise it.
 
===Required Params===
*'''extraRoofCheck''' {{RageType|boolean}}  Checks for vehicle roofs without animation that were added using vehicle extras.
 
===Return value===
*''{{RageType|boolean}}''
 
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">vehicle.isAConvertible(p1);</syntaxhighlight>
<syntaxhighlight lang="javascript">
=== Required Arguments ===
vehicle.isAConvertible(extraRoofCheck)
*'''p1:''' Boolean
</syntaxhighlight>
===Return value===
 
*'''Boolean'''
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
const vehicle = mp.players.local.vehicle;
if (!vehicle || !mp.vehicles.exists(vehicle)) return;
const isConvertible = vehicle.isAConvertible(true);
mp.console.logInfo(`Player's vehicle ${isConvertible ? 'is convertible' : 'is not convertible'}`);
</syntaxhighlight>
</syntaxhighlight>
}}
==See also==
==See also==
{{Vehicle_function_c}}
{{Vehicle_definition_c}}
 
[[Category:Vehicle API]]
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:Client-side Function]]
[[Category:Shared Function]]

Latest revision as of 10:51, 28 April 2024

Client-Side
Function

 JavaScript



JavaScript Syntax

Returns whether given vehicle has a converitble roof and an animation to lower/raise it.

Required Params

  • extraRoofCheck boolean Checks for vehicle roofs without animation that were added using vehicle extras.

Return value

  • boolean

Syntax

vehicle.isAConvertible(extraRoofCheck)

Example

const vehicle = mp.players.local.vehicle;
if (!vehicle || !mp.vehicles.exists(vehicle)) return;
const isConvertible = vehicle.isAConvertible(true);
mp.console.logInfo(`Player's vehicle ${isConvertible ? 'is convertible' : 'is not convertible'}`);



See also