structura foldere

mutat kq- folders in un singur folder [kq]
This commit is contained in:
2026-03-30 01:55:03 +03:00
parent af1286d583
commit c291b81f26
2319 changed files with 0 additions and 14 deletions

View File

@@ -0,0 +1,31 @@
RegisterServerCallback('phone:getBankData', function(source, cb)
local src = source
local bankMoney = GetBankMoney(src)
local invoices = GetInvoices(src)
cb({
balance = bankMoney,
invoices = invoices,
})
end)
RegisterServerCallback('phone:payInvoice', function(source, cb, invoiceId)
local src = source
local bill = MySQL.Sync.fetchAll('SELECT * FROM `phone_bills` WHERE `id` = ?', { invoiceId })
if not bill[1] then
TriggerClientEvent('phone:client:sendTextMessage', src, Lang('PHONE_NOTIFICATION_BANK_BILL_NO_DATA'), 'error')
return cb(false)
end
bill = bill[1]
local price = bill.price
local sender = bill.sender
local bankMoney = GetBankMoney(src)
if bankMoney >= price then
MySQL.Sync.execute('DELETE FROM `phone_bills` WHERE `id` = ?', { invoiceId })
RemoveBankMoney(src, price)
TriggerClientEvent('phone:client:sendTextMessage', src, Lang('PHONE_NOTIFICATION_BANK_BILL_PAID') .. price, 'success')
cb(true)
else
TriggerClientEvent('phone:client:sendTextMessage', src, Lang('PHONE_NOTIFICATION_BANK_BILL_NO_MONEY'), 'error')
cb(false)
end
end)