Hey there,
Here’s my code server side :
RegisterServerEvent("me:IsFirstJoin")
AddEventHandler("me:IsFirstJoin", function(cb)
local query = MySQL:executeQuery("SELECT sid FROM players WHERE sid = '@sid'", {['@sid'] = GetPlayerIdentifiers(source)[1]})
if MySQL:getResults(query, {'sid'})[1] == nil then
cb(false)
else
cb(true)
end
end)
And here’s the code client side that replaces the simple “spawnPlayer()” in the spawnmanager.lua file :
TriggerServerEvent("me:IsFirstJoin", function(b)
if b then
spawnPlayer(--[[Correct values, just hidden for the topic]])
else
spawnPlayer()
end
end)
Finally, here’s the error I have in the console :
Exception during queued callback: Index was outside the bounds of the array.
I tried using a simple event the same way that just prints something out in the console, it worked without any issue.
Any idea ?
Thanks
Edit : I tried adding some debug at the beginning of the callback, it doesn’t trigger