mirror of
https://github.com/jimathy/jim-payments.git
synced 2026-08-17 22:36:03 +01:00
Update 3.0 beta
This commit is contained in:
@@ -7,13 +7,13 @@ if Config.ATMs.enable then
|
||||
for _, v in pairs(GetGamePool('CObject')) do
|
||||
for _, model in pairs(Config.ATMs.ATMModels) do
|
||||
if GetEntityModel(v) == model then
|
||||
local name, entCoords = GetCurrentResourceName()..":ATMLocation:"..v, GetEntityCoords(v)
|
||||
local name, entCoords = getScript()..":ATMLocation:"..v, GetEntityCoords(v)
|
||||
if #(pedCoords - entCoords) <= 150 then
|
||||
if not Targets[name] then
|
||||
Targets[name] =
|
||||
createCircleTarget({name, vec3(entCoords.x, entCoords.y, entCoords.z+1.03), 0.5, { name=name, debugPoly=Config.System.Debug, useZ=true, },},
|
||||
{ { action = function() lookEnt(v) TriggerEvent("jim-payments:Client:ATM") end,
|
||||
icon = "fas fa-money-check-alt", label = Loc[Config.Lan].target["atm"],
|
||||
createCircleTarget({name, vec3(entCoords.x, entCoords.y, entCoords.z+1.03), 0.5, { name=name, debugPoly = debugMode, useZ=true, },},
|
||||
{ { action = function() lookEnt(v) TriggerEvent(getScript()..":Client:ATM") end,
|
||||
icon = "fas fa-money-check-alt", label = locale("target", "atm"),
|
||||
}, }, 1.5)
|
||||
end
|
||||
if Config.ATMs.showBlips then
|
||||
@@ -34,64 +34,65 @@ if Config.ATMs.enable then
|
||||
end)
|
||||
end
|
||||
|
||||
RegisterNetEvent('jim-payments:Client:ATM', function() local setheader = nil
|
||||
RegisterNetEvent(getScript()..":Client:ATM", function() local setheader = nil
|
||||
--this grabs all the info from names to savings account numbers in the databases
|
||||
local info = triggerCallback("jim-payments:GetInfo")
|
||||
local info = triggerCallback(getScript()..":GetInfo")
|
||||
|
||||
playAnim("amb@prop_human_atm@male@enter", "enter", 2000, 1)
|
||||
|
||||
if progressBar({ label = Loc[Config.Lan].menu["acc_atm"], time = 3000 }) then
|
||||
if progressBar({ label = locale("menu", "acc_atm"), time = 3000 }) then
|
||||
local Menu = {}
|
||||
|
||||
Menu[#Menu+1] = {
|
||||
isMenuHeader = true,
|
||||
header = Loc[Config.Lan].menu["welcome"]..info.name,
|
||||
header = locale("menu", "welcome")..info.name,
|
||||
txt = info.cid,
|
||||
}
|
||||
Menu[#Menu+1] = {
|
||||
isMenuHeader = true,
|
||||
header = Loc[Config.Lan].menu["header_balance"],
|
||||
txt = Loc[Config.Lan].menu["bank_balance"]..cv(info.bank)..br..Loc[Config.Lan].menu["cash_balance"]..cv(info.cash)
|
||||
header = locale("menu", "header_balance"),
|
||||
txt = locale("menu", "bank_balance")..cv(info.bank)..br..locale("menu", "cash_balance")..cv(info.cash)
|
||||
}
|
||||
Menu[#Menu+1] = {
|
||||
header = Loc[Config.Lan].menu["withdraw"],
|
||||
header = locale("menu", "withdraw"),
|
||||
onSelect = function()
|
||||
atmWithdrawl(info)
|
||||
end,
|
||||
}
|
||||
local header = Loc[Config.Lan].menu["header_atm"]
|
||||
if Config.System.Menu == "qb" then header = "<center><img src="..Config.General.menuLogo.." width=200px></center>"
|
||||
elseif Config.System.Menu == "ox" then header = ''
|
||||
local header = locale("menu", "header_atm")
|
||||
if Config.System.Menu == "qb" then
|
||||
header = "<center><img src="..Config.General.menuLogo.." width=200px></center>"
|
||||
elseif Config.System.Menu == "ox" then
|
||||
header = ''
|
||||
end
|
||||
openMenu(Menu, { header = header, canClose = true, onExit = function() playAnim("amb@prop_human_atm@male@exit", "exit", 3000, 1) end, })
|
||||
else
|
||||
triggerNotify(nil, Loc[Config.Lan].error["cancel"], "error")
|
||||
triggerNotify(nil, locale("error", "cancel"), "error")
|
||||
end
|
||||
end)
|
||||
|
||||
function atmWithdrawl(info)
|
||||
local setimage = Loc[Config.Lan].menu["header_atm"]
|
||||
local setimage = locale("menu", "header_atm")
|
||||
if Config.System.Menu == "qb" then setimage = "<center><img src="..Config.General.menuLogo.." width=200px></center>"
|
||||
elseif Config.System.Menu == "ox" then setimage = ''
|
||||
end
|
||||
local dialog = createInput(Loc[Config.Lan].menu["header_atm"], {
|
||||
local dialog = createInput(locale("menu", "header_atm"), {
|
||||
{ type = 'radio',
|
||||
name = 'billtype',
|
||||
text =
|
||||
Config.System.Menu == "ox" and Loc[Config.Lan].menu["bank_balance"]..cv(info.bank)..Loc[Config.Lan].menu["cash_balance"]..cv(info.cash)
|
||||
text = Config.System.Menu == "ox" and locale("menu", "bank_balance")..cv(info.bank)..locale("menu", "cash_balance")..cv(info.cash)
|
||||
or
|
||||
setimage..
|
||||
Loc[Config.Lan].menu["header_balance"]..br..
|
||||
Loc[Config.Lan].menu["bank_balance"]..cv(info.bank)..br..
|
||||
Loc[Config.Lan].menu["cash_balance"]..cv(info.cash)..br..br..
|
||||
Loc[Config.Lan].menu["header_option"],
|
||||
locale("menu", "header_balance")..br..
|
||||
locale("menu", "bank_balance")..cv(info.bank)..br..
|
||||
locale("menu", "cash_balance")..cv(info.cash)..br..br..
|
||||
locale("menu", "header_option"),
|
||||
options = {
|
||||
{ value = "withdraw", text = Loc[Config.Lan].menu["withdraw"] },
|
||||
{ value = "withdraw", text = locale("menu", "withdraw") },
|
||||
} },
|
||||
{ type = 'number',
|
||||
isRequired = true,
|
||||
name = 'amount',
|
||||
text = Loc[Config.Lan].menu["header_trans_amount"],
|
||||
text = locale("menu", "header_trans_amount"),
|
||||
min = 0,
|
||||
max = info.bank,
|
||||
},
|
||||
@@ -104,7 +105,7 @@ function atmWithdrawl(info)
|
||||
if not dialog.amount then return end
|
||||
playAnim("amb@prop_human_atm@male@exit", "exit", 3000, 1)
|
||||
Wait(1000)
|
||||
TriggerServerEvent('jim-payments:server:ATM:use', dialog.amount, dialog.billtype, dialog.account, "atm", info.society, info.gsociety)
|
||||
TriggerServerEvent(getScript()..":server:ATM:use", dialog.amount, dialog.billtype, dialog.account, "atm", info.society, info.gsociety)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user