mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
@@ -29,6 +29,17 @@ ensure esx_banking
|
||||
Run the banking.sql into your database. Done.
|
||||
```
|
||||
|
||||
# If you want to create a bank log in another script, you can do it this way! Only server side!
|
||||
```
|
||||
exports["esx_banking"]:logTransaction(source,logType,amount)
|
||||
|
||||
- First param: source - player source
|
||||
- Second param: logType - WITHDRAW,DEPOSIT,TRANSFER_RECEIVE you can only use these log types!
|
||||
- Third param: amount - The amount to be logged
|
||||
|
||||
For example: exports["esx_banking"]:logTransaction(source,"WITHDRAW",200)
|
||||
```
|
||||
|
||||
# Legal
|
||||
### License
|
||||
esx_banking - banking script for ESX
|
||||
|
||||
@@ -268,8 +268,8 @@
|
||||
"LAUNGAGE": {
|
||||
"your_money_title":"saldo",
|
||||
"your_money_desc":"qui puoi vedere il saldo attuale e contanti.",
|
||||
"your_money_cash":"i tuoi soldi",
|
||||
"your_money_bank":"il tuo saldo bancario",
|
||||
"your_money_cash_label":"i tuoi soldi",
|
||||
"your_money_bank_label":"il tuo saldo bancario",
|
||||
"withdraw":"RITIRARE",
|
||||
"deposit":"DEPOSITARE",
|
||||
"transfer":"TRASFERIMENTO",
|
||||
@@ -289,7 +289,7 @@
|
||||
"timeLabel":"tempo",
|
||||
"searchInputPlaceholder":"Cerca ...",
|
||||
"_comment": "tabella Opzioni complete della lingua: inglese, ungherese, italiana puoi trovare qui tutte le lingue: https://cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/",
|
||||
"tableFullLanguage":"Italiano"
|
||||
"tableFullLanguage":"Italian"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -758,6 +758,7 @@ $(document).ready(function(){
|
||||
if(data.openATM){
|
||||
ATMRender()
|
||||
type = "ATM"
|
||||
transaction.setData(transData,languageText)
|
||||
}
|
||||
else{
|
||||
type = "BANK"
|
||||
|
||||
@@ -120,6 +120,38 @@ ESX.RegisterServerCallback("esx_banking:checkPincode", function(source, cb, inpu
|
||||
cb(pincode > 0)
|
||||
end)
|
||||
|
||||
function logTransaction(targetSource,key,amount)
|
||||
if targetSource == nil then
|
||||
print("ERROR: TargetSource nil!")
|
||||
return
|
||||
end
|
||||
|
||||
if key == nil then
|
||||
print("ERROR: Do you need use these: WITHDRAW,DEPOSIT,TRANSFER_RECEIVE")
|
||||
return
|
||||
end
|
||||
|
||||
if type(key) ~= "string" or key == '' then
|
||||
print("ERROR: Do you need use these: WITHDRAW,DEPOSIT,TRANSFER_RECEIVE and can only be string type!")
|
||||
return
|
||||
end
|
||||
|
||||
if amount == nil then
|
||||
print("ERROR: Amount value is nil! Add some numeric value to the amount!")
|
||||
return
|
||||
end
|
||||
|
||||
local xPlayer = ESX.GetPlayerFromId(tonumber(targetSource))
|
||||
|
||||
if xPlayer ~= nil then
|
||||
local bankCurrentMoney = xPlayer.getAccount('bank').money
|
||||
BANK.LogTransaction(targetSource, string.upper(key), amount, bankCurrentMoney)
|
||||
else
|
||||
print("ERROR: xPlayer is nil!")
|
||||
end
|
||||
end
|
||||
exports("logTransaction", logTransaction)
|
||||
|
||||
-- bank functions
|
||||
BANK = {
|
||||
CreatePeds = function()
|
||||
@@ -167,7 +199,7 @@ BANK = {
|
||||
MySQL.update('UPDATE users SET pincode = ? WHERE identifier = ? ', {amount, identifier})
|
||||
end,
|
||||
LogTransaction = function(playerId, logType, amount, bankMoney)
|
||||
if source == nil then
|
||||
if playerId == nil then
|
||||
return
|
||||
end
|
||||
local xPlayer = ESX.GetPlayerFromId(playerId)
|
||||
@@ -176,4 +208,4 @@ BANK = {
|
||||
MySQL.insert('INSERT INTO banking (identifier, type, amount, time, balance) VALUES (?, ?, ?, ?, ?)',
|
||||
{identifier, logType, amount, os.time() * 1000, bankMoney})
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user