mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 23:46:03 +01:00
feat(client/radial): add lib.disableRadial to prevent radial access
This commit is contained in:
@@ -271,11 +271,25 @@ RegisterNUICallback('radialTransition', function(_, cb)
|
||||
cb(true)
|
||||
end)
|
||||
|
||||
local isDisabled = false
|
||||
|
||||
---Disallow players from opening the radial menu.
|
||||
---@param state boolean
|
||||
function lib.disableRadial(state)
|
||||
isDisabled = state
|
||||
|
||||
if isOpen and state then
|
||||
return lib.hideRadial()
|
||||
end
|
||||
end
|
||||
|
||||
lib.addKeybind({
|
||||
name = 'ox_lib-radial',
|
||||
description = 'Open radial menu',
|
||||
defaultKey = 'z',
|
||||
onPressed = function()
|
||||
if isDisabled then return end
|
||||
|
||||
if isOpen then
|
||||
return lib.hideRadial()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user