Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The player can easily enable or disable the test drive. #55

Merged
merged 4 commits into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -335,16 +335,18 @@ local function openVehicleSellMenu()
arrow = true
}
if config.shops[insideShop].type == 'free-use' then
options = {
{
options = {}

if config.enableTestDrive then
options[#options + 1] = {
title = Lang:t('menus.test_header'),
description = Lang:t('menus.freeuse_test_txt'),
event = 'qbx_vehicleshop:client:testDrive',
args = {
vehicle = vehicle
}
}
}
end

if config.enableFreeUseBuy then
options[#options + 1] = {
Expand All @@ -370,13 +372,6 @@ local function openVehicleSellMenu()
options[#options + 1] = swapOption
else
options = {
{
title = Lang:t('menus.test_header'),
description = Lang:t('menus.managed_test_txt'),
onSelect = function()
startTestDrive(vehicle)
end,
},
{
title = Lang:t('menus.managed_sell_header'),
description = Lang:t('menus.managed_sell_txt'),
Expand All @@ -386,6 +381,16 @@ local function openVehicleSellMenu()
}
}

if config.enableTestDrive then
options[#options + 1] = {
title = Lang:t('menus.test_header'),
description = Lang:t('menus.managed_test_txt'),
onSelect = function()
startTestDrive(vehicle)
end
}
end

if config.finance.enable then
options[#options + 1] = {
title = Lang:t('menus.finance_header'),
Expand Down
5 changes: 3 additions & 2 deletions config/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ return {
useTarget = false,
debugPoly = false,
enableFreeUseBuy = true, -- Allows players to buy from NPC shops

enableTestDrive = true,

finance = {
enable = true, -- Enables the financing system. Turning this off does not affect already financed vehicles
commissionRate = 0.05, -- Percent that goes to sales person from a finance sale 5%
Expand Down Expand Up @@ -1778,4 +1779,4 @@ return {
shop = 'pdm',
},
},
}
}
Loading