mysql-async v3.0.1 support

This commit is contained in:
ElPumpo
2018-09-24 17:36:50 +02:00
parent 29f64dd928
commit f108cecbbb
+2 -13
View File
@@ -1,5 +1,4 @@
WhiteList = {}
local hasSqlRun = false
function loadWhiteList(cb)
Whitelist = {}
@@ -9,26 +8,16 @@ function loadWhiteList(cb)
table.insert(WhiteList, tostring(identifiers[i].identifier):lower())
end
hasSqlRun = true
if cb ~= nil then
cb()
end
end)
end
AddEventHandler('onMySQLReady', function()
MySQL.ready(function()
loadWhiteList()
end)
Citizen.CreateThread(function()
Citizen.Wait(10000)
if not hasSqlRun then
loadWhiteList()
end
end)
AddEventHandler('playerConnecting', function(name, setCallback, deferrals)
-- Mark this connection as deferred, this is to prevent problems while checking player identifiers.
deferrals.defer()
@@ -67,4 +56,4 @@ AddEventHandler('playerConnecting', function(name, setCallback, deferrals)
else
deferrals.done(kickReason)
end
end)
end)