Vehicle::setEnginePowerMultiplier: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
Line 6: Line 6:
===Return value===
===Return value===
*'''Undefined'''
*'''Undefined'''
==Example==
==(Clientside) Example==
Boost Emergency Vehicles
 
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
mp.events.add('render', () => {
    if (mp.players.local.vehicle) {
        if (mp.players.local.vehicle.getClass() === 18) {
            mp.players.local.vehicle.setEnginePowerMultiplier(12)
        }
    }
})
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Vehicle_function_c}}
{{Vehicle_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Revision as of 22:14, 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

(Clientside) Example

Boost 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