Vehicle::setEnginePowerMultiplier: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
 
Line 6: Line 6:
===Return value===
===Return value===
*'''Undefined'''
*'''Undefined'''
==(Clientside) Example==
Boost Emergency Vehicles


<syntaxhighlight lang="javascript">
===Example===
{{ClientsideCode|
<pre>
 
//Boosting all emergency vehicles
mp.events.add('render', () => {
mp.events.add('render', () => {
     if (mp.players.local.vehicle) {
     if (mp.players.local.vehicle) {
Line 17: Line 19:
     }
     }
})
})
</syntaxhighlight>
</pre>
}}


==See also==
==See also==
{{Vehicle_function_c}}
{{Vehicle_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]

Latest revision as of 22:17, 26 April 2020

Vehicle power multiplier.
Does not have to be looped each frame. Can be set once.
Values lower than 1f don't work.

Note: If the value is set with GET_RANDOM_FLOAT_IN_RANGE, the vehicle will have an absurdly high ammount of power, and will become almost undrivable for the player or NPCs. The range doesn't seem to matter.

An high value like 10000000000f will visually remove the wheels that apply the power (front wheels for FWD, rear wheels for RWD), but the power multiplier will still apply, and the wheels still work.

Syntax

vehicle.setEnginePowerMultiplier(value);

Required Arguments

  • value: float

Return value

  • Undefined

Example

Client-Side

//Boosting all emergency vehicles
mp.events.add('render', () => {
    if (mp.players.local.vehicle) {
        if (mp.players.local.vehicle.getClass() === 18) {
            mp.players.local.vehicle.setEnginePowerMultiplier(12)
        }
    }
})

See also