Skip to content

Commit

Permalink
fix: only create finance zone if financing is enabled
Browse files Browse the repository at this point in the history
* Update main.lua

There is no need to create a zone if the player has not enabled the financing option.

* Update main.lua

There is no need to create a zone if the player has not enabled the financing option. In other words, after this update, the zone will not be created if you have not enabled the financing option.
  • Loading branch information
Bloope18 authored Jan 7, 2024
1 parent b21dc15 commit bfe3b4a
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -516,23 +516,25 @@ local function init()
end)

CreateThread(function()
lib.zones.box({
coords = config.finance.zone,
size = vec3(2, 2, 4),
rotation = 0,
debug = config.debugPoly,
onEnter = function()
lib.showTextUI(Lang:t('menus.keypress_showFinanceMenu'))
end,
inside = function()
if IsControlJustPressed(0, 38) then
showFinancedVehiclesMenu()
if config.finance.enable then
lib.zones.box({
coords = config.finance.zone,
size = vec3(2, 2, 4),
rotation = 0,
debug = config.debugPoly,
onEnter = function()
lib.showTextUI(Lang:t('menus.keypress_showFinanceMenu'))
end,
inside = function()
if IsControlJustPressed(0, 38) then
showFinancedVehiclesMenu()
end
end,
onExit = function()
lib.hideTextUI()
end
end,
onExit = function()
lib.hideTextUI()
end
})
})
end
end)

CreateThread(function()
Expand Down

0 comments on commit bfe3b4a

Please sign in to comment.