I’ve done some research, but the only script that i found, works partially.
Already tried many ideas to fix the bug that locks the speed at 165 km/h at 144 km/h. Problably the error is at line 29 to 33, that selects the type of vehicles.
I’m trying that on mod vehicles
Citizen.CreateThread( function()
while true do
Citizen.Wait( 100 )
while not IsPedInAnyVehicle(PlayerPedId(), false)
do
Citizen.Wait(5000)
end
local vehicle = GetVehiclePedIsIn(GetPlayerPed(-1), false)
if vehicle ~= nil then
setSpeed(Config.maxSpeed,vehicle)
end
end
end)
function setSpeed(speed,vehicle)
local vehicleDefaultSpeed = GetVehicleEstimatedMaxSpeed(vehicle)
local vehicleClass = GetVehicleClass(vehicle)
if Config.kmh then
speed = speed / 3.6
else
speed = speed / 2.23694
end
SetVehicleMaxSpeed(vehicle, vehicleDefaultSpeed)
if (vehicleClass ~= 16) or (vehicleClass ~= 15) then
if vehicleDefaultSpeed > speed then
SetVehicleMaxSpeed(vehicle, speed)
end
end
end
-- VEHICLE CLASSES
-- id = 0 --compacts
-- id = 1 --sedans
-- id = 2 --SUV's
-- id = 3, --coupes
-- id = 4 --muscle
-- id = 5 --sport classic
-- id = 6 --sport
-- id = 7 --super
-- id = 8 --motorcycle
-- id = 9 --offroad
-- id = 10 --industrial
-- id = 11 -utility
-- id = 12 --vans
-- id = 13 --bicycles
-- id = 14 --boats
-- id = 15, --helicopter
-- id = 16 --plane
-- id = 17 --service
-- id = 18 --emergency
-- id = 19 --military
So, i found the “problem” that’s not a bug at the code, but my fault at configurating the Handling.
<?xml version="1.0"?>
<CHandlingDataMgr>
<HandlingData>
<Item type="CHandlingData">
<handlingName>trail22pc</handlingName>
<fMass value="1000.0" />
<fInitialDragCoeff value="0" />
<fPercentSubmerged value="85.000000" />
<vecCentreOfMassOffset x="0.000000" y="0.000000" z="0.000000" />
<vecInertiaMultiplier x="1.000000" y="1.300000" z="1.500000" />
<fDriveBiasFront value="0.5" />
<nInitialDriveGears value="2" />
<fInitialDriveForce value="0.400000" />
<fDriveInertia value="1.000000" />
<fClutchChangeRateScaleUpShift value="3.400000" />
<fClutchChangeRateScaleDownShift value="3.400000" />
✔ <fInitialDriveMaxFlatVel value="180" /> <----- THIS VALUE, SET AT THE SPEED YOU WANT
<fBrakeForce value="10.900000" />
<fBrakeBiasFront value="0.100000" />
<fHandBrakeForce value="10.000000" />
<fSteeringLock value="40.000000" />
<fTractionCurveMax value="3.0000000" />
<fTractionCurveMin value="2.850000" />
<fTractionCurveLateral value="25.500000" />
<fTractionSpringDeltaMax value="0.130000" />
<fLowSpeedTractionLossMult value="0.70000" />
<fCamberStiffnesss value="0.000000" />
<fTractionBiasFront value="0.5" />
<fTractionLossMult value="0.5000000" />
<fSuspensionForce value="1.700000" />
<fSuspensionCompDamp value="0.20000" />
<fSuspensionReboundDamp value="0.700000" />
<fSuspensionUpperLimit value="0.19" />
<fSuspensionLowerLimit value="-0.16" />
<fSuspensionRaise value="0.0" />
<fSuspensionBiasFront value="0.51" />
<fAntiRollBarForce value="0.300000" />
<fAntiRollBarBiasFront value="0.530000" />
<fRollCentreHeightFront value="0.310000" />
<fRollCentreHeightRear value="0.500000" />
<fCollisionDamageMult value="0.500000" />
<fWeaponDamageMult value="0.500000" />
<fDeformationDamageMult value="0.500000" />
<fEngineDamageMult value="0.500000" />
<fPetrolTankVolume value="100.000000" />
<fOilVolume value="8.000000" />
<fSeatOffsetDistX value="0.000000" />
<fSeatOffsetDistY value="0.000000" />
<fSeatOffsetDistZ value="0.000000" />
<nMonetaryValue value="50000" />
<strModelFlags>2220010</strModelFlags>
<strHandlingFlags>4220000</strHandlingFlags>
<strDamageFlags>0</strDamageFlags>
<sn>01210801</sn>
<AIHandling>AVERAGE</AIHandling>
<SubHandlingData>
<Item type="CCarHandlingData">
<fBackEndPopUpCarImpulseMult value="0.100000" />
<fBackEndPopUpBuildingImpulseMult value="0.030000" />
<fBackEndPopUpMaxDeltaSpeed value="0.600000" />
</Item>
<Item type="NULL" />
<Item type="NULL" />
</SubHandlingData>
</Item>
</HandlingData>
</CHandlingDataMgr>