hello. I want to save steam-identifier in mysql when player is joining in my qbcore server but it prints 1 instead of steam-identifier
this is Client Code that i tested :
local function OnPlayerConnecting(name, setKickReason, deferrals)
local player = source
local steamIdentifier
local identifiers = GetPlayerIdentifiers(player)
deferrals.defer()
-- mandatory wait!
Wait(0)
deferrals.update(string.format("Hello %s. Your Steam ID is being checked.", name))
for _, v in pairs(identifiers) do
if string.find(v, "steam") then
steamIdentifier = v
break
end
end
-- mandatory wait!
Wait(0)
if not steamIdentifier then
deferrals.done("You are not connected to Steam.")
else
TriggerServerEvent("setSteam", steamIdentifier)
deferrals.done()
end
end
AddEventHandler("playerConnecting", OnPlayerConnecting)
and this is Server Code that i tested :
RegisterNetEvent("setSteam")
AddEventHandler("setSteam", function(source, steamIdentifier)
print(steamIdentifier)
end)
Thank for your help