mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 01:08:57 +00:00
Optimizations
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user