update: loading sql

This commit is contained in:
Andyyy7666
2023-07-16 12:31:02 +02:00
parent ee88709043
commit 075807eb51
2 changed files with 28 additions and 10 deletions

View File

@@ -22,6 +22,28 @@ function NDCore.getPlayers(key, value)
return players
end
---@param fileLocation string|tabale
---@return boolean
function NDCore.loadSQL(fileLocation, resource)
local resourceName = resource or GetInvokingResource() or GetCurrentResourceName()
if type(fileLocation) == "string" then
local file = LoadResourceFile(resourceName, fileLocation)
if not file then return end
MySQL.query(file)
return true
end
for i=1, #fileLocation do
local file = LoadResourceFile(resourceName, fileLocation[i])
if file then
MySQL.query(file)
Wait(100)
end
end
return true
end
for name, func in pairs(NDCore) do
if type(func) == "function" then
exports(name, func)