Tiny optimization

This commit is contained in:
Jim Shield
2022-06-08 22:15:39 +01:00
committed by GitHub
parent 284700bafb
commit da5e4c604f

View File

@@ -20,10 +20,7 @@ RegisterServerEvent('jim-payments:Tickets:Give', function(data, biller, popup)
if Config.Debug then print("QB-BossMenu: Adding $"..data.amount.." to account '"..tostring(biller.PlayerData.job.name).."'") end
end
elseif not biller then --Find the biller from their citizenid
for k, v in pairs(QBCore.Functions.GetPlayers()) do
local Player = QBCore.Functions.GetPlayer(v)
if Player.PlayerData.citizenid == data.senderCitizenId then biller = Player end
end
local biller = QBCore.Functions.GetPlayerByCitizenId(data.senderCitizenId)
TriggerClientEvent('QBCore:Notify', biller.PlayerData.source, data.sender.." Paid their $"..data.amount.." invoice", "success")
end
@@ -153,4 +150,4 @@ QBCore.Functions.CreateCallback('jim-payments:MakePlayerList', function(source,
onlineList[#onlineList+1] = { value = tonumber(v), text = "["..v.."] - "..P.PlayerData.charinfo.firstname..' '..P.PlayerData.charinfo.lastname }
end
cb(onlineList)
end)
end)