This repository was archived by the owner on Dec 25, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
337337RegisterNetEvent (' xperience:client:init' , function (...) Xperience :Init (... ) end )
338338RegisterNetEvent (' xperience:client:addXP' , function (...) Xperience :AddXP (... ) end )
Original file line number Diff line number Diff line change @@ -25,3 +25,5 @@ Config.Themes = {
2525
2626Config .UseQBCore = false
2727Config .UseESX = false
28+
29+ Config .ESXIdentifierColumn = ' identifier'
Original file line number Diff line number Diff 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
198204function 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
You can’t perform that action at this time.
0 commit comments