mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
tweak: check for inventory
This commit is contained in:
@@ -25,14 +25,10 @@ CreateThread(function()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
AddEventHandler("onResourceStart", function(resourceName)
|
isResourceStarted("ox_inventory", function(started)
|
||||||
Wait(3000)
|
if not started then return end
|
||||||
if resourceName ~= "ox_inventory" then return end
|
|
||||||
SetConvarReplicated("inventory:framework", "nd")
|
SetConvarReplicated("inventory:framework", "nd")
|
||||||
end)
|
end)
|
||||||
if GetResourceState("ox_inventory") == "started" then
|
|
||||||
SetConvarReplicated("inventory:framework", "nd")
|
|
||||||
end
|
|
||||||
|
|
||||||
for _, roleid in pairs(config.adminRoles) do
|
for _, roleid in pairs(config.adminRoles) do
|
||||||
ExecuteCommand("add_principal identifier.discord:" .. roleid .. " group.admin")
|
ExecuteCommand("add_principal identifier.discord:" .. roleid .. " group.admin")
|
||||||
|
|||||||
@@ -18,7 +18,12 @@ end)
|
|||||||
function isResourceStarted(resourceName, cb)
|
function isResourceStarted(resourceName, cb)
|
||||||
local started = GetResourceState(resourceName) == "started"
|
local started = GetResourceState(resourceName) == "started"
|
||||||
startedResources[resourceName] = started
|
startedResources[resourceName] = started
|
||||||
|
|
||||||
|
if cb then
|
||||||
callbacks[resourceName] = cb
|
callbacks[resourceName] = cb
|
||||||
|
cb(started)
|
||||||
|
end
|
||||||
|
|
||||||
return started
|
return started
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user