Update server.lua

This commit is contained in:
Nordi98 2025-06-29 05:32:27 +02:00
parent a436fe0287
commit 7167055241

View file

@ -329,11 +329,11 @@ AddEventHandler("okokBanking:SetIBAN", function(iban)
json.encode(charinfo),
Player.PlayerData.citizenid
})
-- Aktualisiere die IBAN im Client (DIESE ZEILE HINZUFÜGEN)
TriggerClientEvent('okokBanking:updateIban', src, iban)
end)
QBCore.Functions.CreateCallback("okokBanking:HasCreditCard", function(source, cb)
local xPlayer = QBCore.Functions.GetPlayer(source)
if xPlayer ~= nil then
@ -1522,12 +1522,11 @@ AddEventHandler("okokBanking:UpdateIbanDB", function(iban, amount)
local updated = json.encode(charinfo)
MySQL.query('UPDATE players SET charinfo = ? WHERE citizenid = ?', {updated, xPlayer.PlayerData.citizenid})
end)
if xPlayer.Functions.ChangeIban then
xPlayer.Functions.ChangeIban(iban)
else
TriggerClientEvent('okokNotify:Alert', _source, 'OKOKBANKING', 'Unable to locate or identify the function ChangeIban. Please refer to the documentation for correct usage and placement!', 5000, 'warning')
return
end
local charinfo = xPlayer.PlayerData.charinfo
charinfo.iban = iban
xPlayer.Functions.SetPlayerData('charinfo', charinfo)
xPlayer.Functions.RemoveMoney('bank', amount)
xPlayer = QBCore.Functions.GetPlayer(_source)
local itemCash = xPlayer.Functions.GetItemByName("cash")