loadTunedSetup
loadTunedSetup (engineHash [string] ,transmissionData [table] ,tyreCompound [string] powerMultiplier [float] ,weightMultiplier [float] ,brakesMultiplier [float])
Applies the specified tuning bits for the vehicle. If applying sole a specific bit, and not all possible combinations, pass the missing args as "nil". Code Example:
WarMenu.Button("Select Your Engine", '← '..tostring(currentAvailableEngines[selectedEngineIdx])..' →')
if WarMenu.IsItemHovered() then
WarMenu.ToolTip('User the arrow keys to choose available engine swaps.',nil,true)
if IsControlJustReleased(2, 189) then
selectedEngineIdx = selectedEngineIdx - 1
if selectedEngineIdx < 1 then
selectedEngineIdx = #currentAvailableEngines
end
end
if IsControlJustReleased(2, 190) then
selectedEngineIdx = selectedEngineIdx + 1
if selectedEngineIdx > #currentAvailableEngines then
selectedEngineIdx = 1
end
end
end
WarMenu.Button("Select Your Tyre", '← '..tostring(currentAvailableTyres[selectedTyreIdx])..' →')
if WarMenu.IsItemHovered() then
WarMenu.ToolTip('User the arrow keys to swap through available cameras.',nil,true)
if IsControlJustReleased(2, 189) then
selectedTyreIdx = selectedTyreIdx - 1
if selectedTyreIdx < 1 then
selectedTyreIdx = #currentAvailableTyres
end
end
if IsControlJustReleased(2, 190) then
selectedTyreIdx = selectedTyreIdx + 1
if selectedTyreIdx > #currentAvailableTyres then
selectedTyreIdx = 1
end
end
end
inputContextButton(
"Current Gear Ammount: ",
"Gear Ammount:",
"The current designed gear ammount for this tune.",
1, 15, 1, 1,
currentGearAmmount,
function(val)
currentGearAmmount = val
end
)
for i = 1,currentGearAmmount do
if currentTransmissionData.gearRatios[i] == nil then
currentTransmissionData.gearRatios[i] = 0.5
end
inputContextButton(
"Gear "..(i).." Ratio: ",
"Gear "..(i).." Ratio: ",
"Use the arrow keys or press enter to alter the ratio for this gear.",
1, 15, 1, 0.01,
currentTransmissionData.gearRatios[i],
function(val)
currentTransmissionData.gearRatios[i] = val
end
)
end
inputContextButton(
"Transmission Max Speed: ",
"Transmission Max Speed: ",
"Use the arrow keys or press enter to alter the max speed for this transmission.",
5, 350, 5, 5,
currentTransmissionData.maxSpeed,
function(val)
currentTransmissionData.maxSpeed = val
end
)
inputContextButton(
"Transmission Shift Time: ",
"Transmission Shift Time: ",
"Use the arrow keys or press enter to alter the Shift Time for this transmission.",
125, 1000, 125, 25,
currentTransmissionData.shiftingTime,
function(val)
currentTransmissionData.shiftingTime = val
end
)
inputContextButton(
"Power Multiplier: ",
"Power Multiplier: ",
"Use the arrow keys or press enter to alter the power multiplier.",
1.0, 5.0, 0.1, 0.05,
currentPowerMulti,
function(val)
currentPowerMulti = val
end
)
inputContextButton(
"Weight Multiplier: ",
"Weight Multiplier: ",
"Use the arrow keys or press enter to alter the weight multiplier.",
1.0, 5.0, 0.1, 0.05,
currnetWeightMulti,
function(val)
currnetWeightMulti = val
end
)
inputContextButton(
"Brakes Multiplier: ",
"Brakes Multiplier: ",
"Use the arrow keys or press enter to alter the brakes multiplier.",
1.0, 5.0, 0.1, 0.05,
currentBrakeMulti,
function(val)
currentBrakeMulti = val
end
)
local applyTunePressed = WarMenu.Button("Apply Tune")
if WarMenu.IsItemHovered() then
WarMenu.ToolTip('Applies your created tune profile.',nil,true)
end
if applyTunePressed then
local engineSwap = currentAvailableEngines[selectedEngineIdx]
local tyreSwap = currentAvailableTyres[selectedTyreIdx]
dynamic:loadTunedSetup(engineSwap,currentTransmissionData,tyreSwap,currentPowerMulti,currnetWeightMulti,currentBrakeMulti)
end