Skip to content
This repository was archived by the owner on Dec 25, 2023. It is now read-only.

Commit bb9be0b

Browse files
committed
v0.3.1
1 parent ce54296 commit bb9be0b

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

client/main.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ end
332332
-- EVENT HANDLERS --
333333
----------------------------------------------------
334334

335-
AddEventHandler(event, function() Wait(200) TriggerServerEvent('xperience:server:load') end)
335+
RegisterNetEvent(event, function() Wait(1000) TriggerServerEvent('xperience:server:load') end)
336336

337337
RegisterNetEvent('xperience:client:init', function(...) Xperience:Init(...) end)
338338
RegisterNetEvent('xperience:client:addXP', function(...) Xperience:AddXP(...) end)

config.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ Config.Themes = {
2525

2626
Config.UseQBCore = false
2727
Config.UseESX = false
28+
29+
Config.ESXIdentifierColumn = 'identifier'

server/main.lua

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,13 @@ function Xperience:Load(src)
5959
local license = self:GetPlayer(src)
6060

6161
if Config.UseESX then
62-
MySQL.Async.fetchAll('SELECT * FROM users WHERE license = ?', { license }, function(res)
62+
local statement = 'SELECT * FROM users WHERE license = ?'
63+
64+
if Config.ESXIdentifierColumn == 'identifier' then
65+
statement = 'SELECT * FROM users WHERE identifier = ?'
66+
end
67+
68+
MySQL.Async.fetchAll(statement, { license }, function(res)
6369
if res[1] then
6470
result = {}
6571
result.xp = tonumber(res[1].xp)
@@ -198,11 +204,11 @@ end
198204
function Xperience:GetPlayer(src)
199205
for _, id in pairs(GetPlayerIdentifiers(src)) do
200206
if string.sub(id, 1, string.len('license:')) == 'license:' then
201-
if Config.UseESX then
207+
if Config.UseESX and Config.ESXIdentifierColumn == 'license' then
202208
return id
203-
else
204-
return string.sub(id, 9, string.len(id))
205209
end
210+
211+
return string.sub(id, 9, string.len(id))
206212
end
207213
end
208214

0 commit comments

Comments
 (0)