Adjusted servercallback for new method

This commit is contained in:
jimathy
2022-02-17 12:44:17 +00:00
committed by GitHub
parent 3e9570607a
commit a5e09e4c49

View File

@@ -64,8 +64,10 @@ RegisterServerEvent("jim-payments:server:Charge", function(citizen, price, billt
else TriggerClientEvent('QBCore:Notify', source, "You can't charge $0", 'error') return end
end)
QBCore.Functions.CreateCallback('jim-payments:Name:Find', function(source, cb, userid)
local Player = QBCore.Functions.GetPlayer(tonumber(userid))
local name = Player.PlayerData.charinfo.firstname..' '..Player.PlayerData.charinfo.lastname
cb(name)
QBCore.Functions.CreateCallback('jim-payments:MakePlayerList', function(source, cb)
local onlineList = {}
for k, v in pairs(QBCore.Functions.GetPlayers()) do
onlineList[#onlineList+1] = { value = tonumber(v), text = "["..v.."] - "..QBCore.Players[v].PlayerData.charinfo.firstname..' '..QBCore.Players[v].PlayerData.charinfo.lastname }
end
cb(onlineList)
end)