Skip to content

Commit

Permalink
moved radial menu item creation code to qb-customs
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasDev17 committed Mar 19, 2022
1 parent 51a4f99 commit 874e1de
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion client/cl_bennys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ local originalXenonState = nil
local originalTurboState = nil
local attemptingPurchase = false
local isPurchaseSuccessful = false
local radialMenuItemId = nil

-----------------------
---- Functions ----
Expand Down Expand Up @@ -893,9 +894,19 @@ CreateThread(function()
['heading'] = spot.heading
}
exports['qb-core']:DrawText(data.drawtextui.text, 'left')
local customsMenu = {
id = 'customs',
title = 'Enter Customs',
icon = 'wrench',
type = 'client',
event = 'qb-customs:client:EnterCustoms',
shouldClose = true
}
radialMenuItemId = exports['qb-radialmenu']:AddOption(customsMenu, radialMenuItemId)
elseif CustomsData['location'] == location and CustomsData['spot'] == _name then
CustomsData = {}
exports['qb-core']:HideText()
exports['qb-radialmenu']:RemoveOption(radialMenuItemId)
end
end)
end
Expand Down Expand Up @@ -951,7 +962,6 @@ RegisterNetEvent("qb-customs:client:purchaseFailed", function()
QBCore.Functions.Notify("Not enough money", "error")
end)


RegisterNetEvent('qb-customs:client:EnterCustoms', function(override)
if not override.coords or not override.heading then override = nil end
if not IsPedInAnyVehicle(PlayerPedId(), false) or isPlyInBennys or (not next(CustomsData) and not override) then return end
Expand Down

0 comments on commit 874e1de

Please sign in to comment.