Vehicle::isBumperBrokenOff: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
Line 1: Line 1:
{{ClientsideJsFunction}}
{{JSContainer|
Checks whether front or back bumper is broken off vehicle.
=== Required Params ===
*'''front:''' {{RageType|Boolean}}
=== Return Value ===
*'''bool''' {{RageType|Boolean}}


==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">vehicle.isBumperBrokenOff(front);</syntaxhighlight>
<pre>
=== Required Arguments ===
vehicle.isBumperBrokenOff(front);
*'''front:''' Boolean
</pre>
===Return value===
 
*'''Boolean'''
==Example==
==Example==
{{ClientsideCode|
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
const vehicle = mp.vehicles.atRemoteId(0);
if (!vehicle || !mp.vehicles.exists(vehicle)) return;
mp.console.logInfo(`Front bumper is ${vehicle.isBumperBrokenOff(true) ? 'broken' : 'not broken'}`)
</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 18:10, 23 April 2024

Client-Side
Function

 JavaScript



JavaScript Syntax

Checks whether front or back bumper is broken off vehicle.

Required Params

  • front: Boolean

Return Value

  • bool Boolean

Syntax

vehicle.isBumperBrokenOff(front);

Example

Client-Side
const vehicle = mp.vehicles.atRemoteId(0);
if (!vehicle || !mp.vehicles.exists(vehicle)) return;
mp.console.logInfo(`Front bumper is ${vehicle.isBumperBrokenOff(true) ? 'broken' : 'not broken'}`)


See also