diff --git a/server.lua b/server.lua index 97c76f5..ad40a5c 100644 --- a/server.lua +++ b/server.lua @@ -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) \ No newline at end of file +end)