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
+1 -1
View File
@@ -522,7 +522,7 @@ end
---@return boolean, string?
function QBCore.Functions.IsPlayerBanned(source)
local plicense = QBCore.Functions.GetIdentifier(source, 'license')
local result = MySQL.single.await('SELECT * FROM bans WHERE license = ?', { plicense })
local result = MySQL.single.await('SELECT id, reason, expire FROM bans WHERE license = ?', { plicense })
if not result then return false end
if os.time() < result.expire then
local timeTable = os.date('*t', tonumber(result.expire))