Skip to content

Commit

Permalink
Merge pull request #165 from reyyghi/patch-1
Browse files Browse the repository at this point in the history
Update main.lua
  • Loading branch information
GhzGarage authored Feb 29, 2024
2 parents 0dffb9b + 66197e4 commit 377afb4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ end
local function AddOption(data, id)
local menuID = id ~= nil and id or (#DynamicMenuItems + 1)
DynamicMenuItems[menuID] = deepcopy(data)
DynamicMenuItems[menuID].res = GetInvokingResource()
return menuID
end

Expand Down Expand Up @@ -385,6 +386,14 @@ RegisterNetEvent('qb-radialmenu:flipVehicle', function()
end)
end)

AddEventHandler('onClientResourceStop', function(resource)
for k, v in pairs(DynamicMenuItems) do
if v.res == resource then
DynamicMenuItems[k] = nil
end
end
end)

-- NUI Callbacks

RegisterNUICallback('closeRadial', function(data, cb)
Expand Down

0 comments on commit 377afb4

Please sign in to comment.