mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 13:56:02 +01:00
feat: admin group panel
This commit is contained in:
32
client/groupadmin.lua
Normal file
32
client/groupadmin.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
local isOpen = false
|
||||
|
||||
RegisterNUICallback("hide", function(_, cb)
|
||||
isOpen = false
|
||||
SetNuiFocus(false, false)
|
||||
cb("ok")
|
||||
end)
|
||||
|
||||
RegisterNUICallback("groups:create", function(data, cb)
|
||||
local result = lib.callback.await("ND_Core:groups:create", false, data)
|
||||
cb(result or {})
|
||||
end)
|
||||
|
||||
RegisterNUICallback("groups:edit", function(data, cb)
|
||||
local result = lib.callback.await("ND_Core:groups:edit", false, data)
|
||||
cb(result or {})
|
||||
end)
|
||||
|
||||
RegisterNUICallback("groups:delete", function(data, cb)
|
||||
local result = lib.callback.await("ND_Core:groups:delete", false, data)
|
||||
cb(result or {})
|
||||
end)
|
||||
|
||||
RegisterNetEvent("ND:openGroupAdmin", function(groups)
|
||||
if isOpen then return end
|
||||
isOpen = true
|
||||
SetNuiFocus(true, true)
|
||||
SendNUIMessage({
|
||||
type = "groups:open",
|
||||
groups = groups
|
||||
})
|
||||
end)
|
||||
@@ -15,7 +15,7 @@ Config = {
|
||||
randomUnlockedVehicleChance = GetConvarInt("core:randomUnlockedVehicleChance", 30),
|
||||
requireKeys = GetConvarInt("core:requireKeys", 1) == 1,
|
||||
useInventoryForKeys = GetConvarInt("core:useInventoryForKeys", 1) == 1,
|
||||
groups = json.decode(GetConvar("core:groups", "[]")),
|
||||
groups = {},
|
||||
compatibility = json.decode(GetConvar("core:compatibility", "[]")),
|
||||
lockpickTries = GetConvarInt("core:lockpickTries", 3)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user