Vehicle::getVehicleModelMaxSpeed: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
Line 1: Line 1:
Returns max speed (without mods) of the specified vehicle model in m/s.<br><br>For a full list, see here: pastebin.com/AUuHHK06<br><br>GET_VEHICLE_MODEL_*
__TOC__
 
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">mp.game.vehicle.getVehicleModelMaxSpeed(modelHash);</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.game.vehicle.getVehicleModelMaxSpeed(modelHash);</syntaxhighlight>
=== Required Arguments ===
 
=== '''Required Arguments:''' ===
*'''modelHash:''' Model hash or name
*'''modelHash:''' Model hash or name
===Return value===
 
=== '''Return value'''===
*'''float'''
*'''float'''
-----------
*List of maximum vehicle [https://pastebin.com/AUuHHK06 speeds]
==Example==
==Example==
<syntaxhighlight lang="javascript" highlight='2'>
<syntaxhighlight lang="javascript" highlight='2'>

Revision as of 15:48, 1 January 2018

Syntax

mp.game.vehicle.getVehicleModelMaxSpeed(modelHash);

Required Arguments:

  • modelHash: Model hash or name

Return value

  • float


  • List of maximum vehicle speeds

Example

mp.events.add('render', () => {
let maxs = mp.game.vehicle.getVehicleModelMaxSpeed(localPlayer.vehicle.model); //max speed of vehicle 
    let currents = localPlayer.vehicle.getSpeed(); // Current Speed
    mp.game.graphics.drawText(`Speed: ${(currents * 3.6).toFixed(0)}/ ${((maxs * 3.6).toFixed(0))} km/h`, [0.5, 0.005], {  
        font: 7, 
        color: [255, 255, 255, 185], 
        scale: [0.5, 0.5], 
        outline: false
    }); // Displays on the top of the screen Speed: CurrentSpeed/Max speed in km/h

See also