hotfix for leaving the charging player in the list

Left this out while testing on private test server
This commit is contained in:
jimathy
2022-02-06 15:48:41 +00:00
committed by GitHub
parent b78c6dc3a9
commit 2837a808f1

View File

@@ -68,7 +68,7 @@ QBCore.Functions.CreateCallback('jim-payments:server:GetCurrentPlayers', functio
local SPlayer = QBCore.Functions.GetPlayer(source)
for k, v in pairs(QBCore.Functions.GetPlayers()) do
local Player = QBCore.Functions.GetPlayer(v)
if Player ~= nil then
if Player ~= nil and v ~= source then
local dist = #(vector3(Player.PlayerData.position.x, Player.PlayerData.position.y, Player.PlayerData.position.z) - vector3(SPlayer.PlayerData.position.x, SPlayer.PlayerData.position.y, SPlayer.PlayerData.position.z))
if dist <= Config.PaymentRadius then onlineList[#onlineList+1] = { value = tonumber(v), text = "["..v.."] - "..Player.PlayerData.charinfo.firstname..' '..Player.PlayerData.charinfo.lastname..' ('..dist..'m)' }
elseif dist > Config.PaymentRadius then end