From 040aa7f07f713290619bafdfd72d40aee03fb0f0 Mon Sep 17 00:00:00 2001 From: ANTOND <71350868+antond15@users.noreply.github.com> Date: Sun, 1 May 2022 16:27:27 +0200 Subject: [PATCH] fix(players): Player source with qb-core --- fxmanifest.lua | 2 +- resource/server/players.lua | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fxmanifest.lua b/fxmanifest.lua index 9cdf764..560153c 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -4,7 +4,7 @@ lua54 'yes' name 'ac_radio' author 'ANTOND.#8507' -version '1.0.2' +version '1.0.3' description 'FiveM radio for pma-voice' repository 'https://github.com/antond15/ac_radio' diff --git a/resource/server/players.lua b/resource/server/players.lua index fa7346c..8eb8a69 100644 --- a/resource/server/players.lua +++ b/resource/server/players.lua @@ -24,9 +24,10 @@ if server.framework == 'esx' then -- qb-core elseif server.framework == 'qb' then AddEventHandler('QBCore:Server:PlayerLoaded', function(qbPlayer) - onLoaded(source) + local source = qbPlayer.PlayerData.source local job = qbPlayer.PlayerData.job - server.players[qbPlayer.PlayerData.source] = { [job.name] = job.grade.level } + onLoaded(source) + server.players[source] = { [job.name] = job.grade.level } end) AddEventHandler('QBCore:Server:OnJobUpdate', function(source, job)