GetVehicleEstimatedMaxSpeed
Docslocal retval = GetVehicleEstimatedMaxSpeed(vehicle)Description
Introduced in build 323
Retrieves a static value representing the estimated max speed of a specific vehicle, including any vehicle mods. This value does not change dynamically during gameplay.
Parameters
| Name | Type | Description |
|---|---|---|
vehicle | Vehicle | The vehicle for which to obtain the estimated max speed. |
Quick Snippet: Get Vehiclevehicle
vehicleUse this to get the current vehicle handle for this native.
-- Get the vehicle the player is currently in
local ped = PlayerPedId()
local vehicle = GetVehiclePedIsIn(ped, false)
if vehicle ~= 0 then
print("Vehicle handle: " .. vehicle)
print("Model: " .. GetEntityModel(vehicle))
else
print("Player is not in a vehicle")
endVehicle Models

adder
alpha
blade
ardent
asea
cogcabrio
baller
blistaReturns
floatReturns a floating-point number.
Examples
Official
-- This example prints the estimated max speed of the player's current vehicle.
-- Retrieve the player ped.
local playerPed = PlayerPedId()
-- Retrieve the vehicle the player is currently in.
local vehicle = GetVehiclePedIsIn(playerPed, false)
-- If the vehicle does not exist, end the execution of the code here.
if not DoesEntityExist(vehicle) then
return
end
-- Retrieve the estimated max speed of the vehicle.
local estimatedMaxSpeed = GetVehicleEstimatedMaxSpeed(vehicle)
-- Print the estimated max speed of the vehicle.
print("Estimated Max Speed: " .. estimatedMaxSpeed)