Optimizations

This commit is contained in:
EinS4ckZwiebeln
2024-03-28 12:56:32 +01:00
parent 5c60c94197
commit 868600197d
3 changed files with 21 additions and 12 deletions
+12
View File
@@ -59,6 +59,18 @@ function QBCore.Player.GetOfflinePlayer(citizenid)
end
function QBCore.Player.GetPlayerByLicense(license)
if license then
local source = QBCore.Functions.GetSource(license)
if source > 0 then
return QBCore.Players[source]
else
return QBCore.Player.GetOfflinePlayerByLicense(license)
end
end
return nil
end
function QBCore.Player.GetOfflinePlayerByLicense(license)
if license then
local PlayerData = MySQL.prepare.await('SELECT * FROM players where license = ?', { license })
if PlayerData then