diff --git a/bridge/qb/client/functions.lua b/bridge/qb/client/functions.lua index 0ef6d5b23..76c244645 100644 --- a/bridge/qb/client/functions.lua +++ b/bridge/qb/client/functions.lua @@ -417,7 +417,7 @@ function functions.SetVehicleProperties(vehicle, props) props.modRoofLivery = props.modRoofLivery or props.liveryRoof --- lib.setVehicleProperties copied and pasted from Overextended below so that we can remove the error so that setting properties is best effort - assert(DoesEntityExist(vehicle), string.format('Unable to set vehicle properties for "%s" (entity does not exist)', vehicle)) + assert(DoesEntityExist(vehicle), ('Unable to set vehicle properties for "%s" (entity does not exist)'):format(vehicle)) if NetworkGetEntityIsNetworked(vehicle) and NetworkGetEntityOwner(vehicle) ~= cache.playerId then lib.print.warn('setting vehicle properties on non entity owner client. This may cause certain properties to fail to set. entity:', vehicle) diff --git a/client/events.lua b/client/events.lua index 507642f0c..d7b1d10b0 100644 --- a/client/events.lua +++ b/client/events.lua @@ -17,7 +17,7 @@ end) ---@param val PlayerData RegisterNetEvent('QBCore:Player:SetPlayerData', function(val) local invokingResource = GetInvokingResource() - if invokingResource and invokingResource ~= GetCurrentResourceName() then return end + if invokingResource and invokingResource ~= cache.resource then return end QBX.PlayerData = val end) diff --git a/server/functions.lua b/server/functions.lua index 8e2788f77..a076b7ae9 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -402,7 +402,7 @@ exports('Notify', Notify) ---@return string version local function GetCoreVersion(InvokingResource) ---@diagnostic disable-next-line: missing-parameter - local resourceVersion = GetResourceMetadata(GetCurrentResourceName(), 'version') + local resourceVersion = GetResourceMetadata(cache.resource, 'version') if InvokingResource and InvokingResource ~= '' then lib.print.debug(('%s called qbcore version check: %s'):format(InvokingResource or 'Unknown Resource', resourceVersion)) end diff --git a/server/player.lua b/server/player.lua index df2398cd0..e09717ba2 100644 --- a/server/player.lua +++ b/server/player.lua @@ -90,7 +90,7 @@ function SetPlayerPrimaryJob(citizenid, jobName) if not player then return false, { code = 'player_not_found', - message = string.format('player not found with citizenid %s', citizenid) + message = ('player not found with citizenid %s'):format(citizenid) } end @@ -98,7 +98,7 @@ function SetPlayerPrimaryJob(citizenid, jobName) if not grade then return false, { code = 'player_not_in_job', - message = string.format('player %s does not have job %s', citizenid, jobName) + message = ('player %s does not have job %s'):format(citizenid, jobName) } end @@ -106,11 +106,11 @@ function SetPlayerPrimaryJob(citizenid, jobName) if not job then return false, { code = 'job_not_found', - message = jobName .. ' does not exist in core memory' + message = ('%s does not exist in core memory'):format(jobName) } end - assert(job.grades[grade] ~= nil, string.format('job %s does not have grade %s', jobName, grade)) + assert(job.grades[grade] ~= nil, ('job %s does not have grade %s'):format(jobName, grade)) player.PlayerData.job = toPlayerJob(jobName, job, grade) player.Functions.Save() @@ -145,14 +145,14 @@ function AddPlayerToJob(citizenid, jobName, grade) if not job then return false, { code = 'job_not_found', - message = jobName .. ' does not exist in core memory' + message = ('%s does not exist in core memory'):format(jobName) } end if not job.grades[grade] then return false, { code = 'job_missing_grade', - message = string.format('job %s does not have grade %s', jobName, grade), + message = ('job %s does not have grade %s'):format(jobName, grade), } end @@ -160,7 +160,7 @@ function AddPlayerToJob(citizenid, jobName, grade) if not player then return false, { code = 'player_not_found', - message = string.format('player not found with citizenid %s', citizenid) + message = ('player not found with citizenid %s'):format(citizenid) } end @@ -210,7 +210,7 @@ function RemovePlayerFromJob(citizenid, jobName) if not player then return false, { code = 'player_not_found', - message = string.format('player not found with citizenid %s', citizenid) + message = ('player not found with citizenid %s'):format(citizenid) } end @@ -249,7 +249,7 @@ local function setPlayerPrimaryGang(citizenid, gangName) if not player then return false, { code = 'player_not_found', - message = string.format('player not found with citizenid %s', citizenid) + message = ('player not found with citizenid %s'):format(citizenid) } end @@ -257,7 +257,7 @@ local function setPlayerPrimaryGang(citizenid, gangName) if not grade then return false, { code = 'player_not_in_gang', - message = string.format('player %s does not have gang %s', citizenid, gangName) + message = ('player %s does not have gang %s'):format(citizenid, gangName) } end @@ -265,11 +265,11 @@ local function setPlayerPrimaryGang(citizenid, gangName) if not gang then return false, { code = 'gang_not_found', - message = gangName .. ' does not exist in core memory' + message = ('%s does not exist in core memory'):format(gangName) } end - assert(gang.grades[grade] ~= nil, string.format('gang %s does not have grade %s', gangName, grade)) + assert(gang.grades[grade] ~= nil, ('gang %s does not have grade %s'):format(gangName, grade)) player.PlayerData.gang = { name = gangName, @@ -312,14 +312,14 @@ function AddPlayerToGang(citizenid, gangName, grade) if not gang then return false, { code = 'gang_not_found', - message = gangName .. ' does not exist in core memory' + message = ('%s does not exist in core memory'):format(gangName) } end if not gang.grades[grade] then return false, { code = 'gang_missing_grade', - message = string.format('gang %s does not have grade %s', gangName, grade) + message = ('gang %s does not have grade %s'):format(gangName, grade) } end @@ -327,7 +327,7 @@ function AddPlayerToGang(citizenid, gangName, grade) if not player then return false, { code = 'player_not_found', - message = string.format('player not found with citizenid %s', citizenid) + message = ('player not found with citizenid %s'):format(citizenid) } end @@ -377,7 +377,7 @@ local function removePlayerFromGang(citizenid, gangName) if not player then return false, { code = 'player_not_found', - message = string.format('player not found with citizenid %s', citizenid) + message = ('player not found with citizenid %s'):format(citizenid) } end diff --git a/server/storage/players.lua b/server/storage/players.lua index 8c359acbb..5818692b3 100644 --- a/server/storage/players.lua +++ b/server/storage/players.lua @@ -166,7 +166,7 @@ local function handleSearchFilters(filters) end end end - return string.format(' WHERE %s', table.concat(clauses, ' AND ')), holders + return (' WHERE %s'):format(table.concat(clauses, ' AND ')), holders end ---@param filters table