525 lines
20 KiB
Lua
525 lines
20 KiB
Lua
Config = {}
|
|
Config.Framework = 'autodetect' -- newesx, oldesx, newqb, oldqb, autodetect
|
|
Config.Mysql = "oxmysql"
|
|
Config.InteractionHandler = 'drawtext' -- bt-target, qb-target, drawtext, qtarget, ox-target
|
|
Config.Billing = 'codem-billing' -- 'codem-billing', 'codem-billingv2', 'okok', 'default'
|
|
Config.newManagementSystem = false
|
|
Config.CreateJobAccount = true
|
|
|
|
Citizen.CreateThread(function()
|
|
if Config.Billing == 'codem-billing' then
|
|
Config.Tax = 0.18
|
|
Config.BillSettings = {
|
|
{name = 'police', label = 'LSPD'},
|
|
{name = 'ambulance', label = 'EMS'}
|
|
}
|
|
else
|
|
Config.BillSettings = {
|
|
{name = 'society_police', label = 'LSPD'},
|
|
{name = 'society_ambulance', label = 'EMS'}
|
|
}
|
|
end
|
|
end)
|
|
|
|
Config.SocietyJob = {
|
|
{name = 'police', token = 'police123', cardNumber = '**** **** **PO LICE'},
|
|
{name = 'ambulance', token = 'ambulance123', cardNumber = '**** **** **** *EMS'},
|
|
{name = 'mechanic', token = 'ambulance123', cardNumber = '**** **** MECH ANIK'},
|
|
}
|
|
|
|
Config.BillSettings = {
|
|
{name = 'police', label = 'LSPD'},
|
|
{name = 'ambulance', label = 'EMS'}
|
|
}
|
|
|
|
Config.Logo = {
|
|
['bluelogo'] = 'https://images.guns.lol/13ce84134d54a9db53288ce4761e9062fbebdad3/QwKzgg.png',
|
|
['whitelogo'] = 'https://images.guns.lol/13ce84134d54a9db53288ce4761e9062fbebdad3/QwKzgg.png',
|
|
['atmlogo'] = 'https://images.guns.lol/13ce84134d54a9db53288ce4761e9062fbebdad3/QwKzgg.png',
|
|
['purplelogo'] = 'https://images.guns.lol/13ce84134d54a9db53288ce4761e9062fbebdad3/QwKzgg.png'
|
|
}
|
|
|
|
Config.Blip = {
|
|
blipName = 'Bank',
|
|
blipType = 108,
|
|
blipColor = 2,
|
|
blipScale = 0.55
|
|
}
|
|
|
|
Config.BankLocations = {
|
|
{coords = vector3(149.9, -1040.46, 29.37)},
|
|
{coords = vector3(314.23, -278.83, 54.17)},
|
|
{coords = vector3(-350.8, -49.57, 49.04)},
|
|
{coords = vector3(-1213.0, -330.39, 37.79)},
|
|
{coords = vector3(-2962.71, 483.0, 15.7)},
|
|
{coords = vector3(1175.07, 2706.41, 38.09)},
|
|
{coords = vector3(246.64, 223.20, 106.29)},
|
|
{coords = vector3(-113.22, 6470.03, 31.63)},
|
|
}
|
|
|
|
Config.ATMModels = {
|
|
{prop = "prop_atm_01"},
|
|
{prop = "prop_atm_02"},
|
|
{prop = "prop_atm_03"},
|
|
{prop = "prop_fleeca_atm"},
|
|
}
|
|
|
|
Config.OpenTrigger = function()
|
|
if Config.InteractionHandler == "qb-target" then
|
|
|
|
for _, v in pairs(Config.BankLocations) do
|
|
exports['qb-target']:AddBoxZone("codembank" .. _, vector3(v.coords.x, v.coords.y, v.coords.z), 1.5, 1.5, {
|
|
name = "codembank" .. _,
|
|
debugPoly = false,
|
|
heading = -20,
|
|
minZ = v.coords.z - 2,
|
|
maxZ = v.coords.z + 2,
|
|
}, {
|
|
options = {
|
|
{
|
|
type = "client",
|
|
event = "codem-bank:openBank",
|
|
icon = 'fas fa-credit-card',
|
|
label = "Open Bank",
|
|
},
|
|
},
|
|
distance = 8
|
|
})
|
|
end
|
|
|
|
Citizen.CreateThread(function()
|
|
while true do
|
|
local wait = 1500
|
|
local playerPed = PlayerPedId()
|
|
local coords = GetEntityCoords(playerPed)
|
|
for k, v in pairs(Config.ATMModels) do
|
|
local obj = GetClosestObjectOfType(GetEntityCoords(PlayerPedId()), 2.0, GetHashKey(v.prop))
|
|
local distance = #(coords - GetEntityCoords(obj))
|
|
if distance < 1.5 then
|
|
exports['qb-target']:AddBoxZone("codematm" .. k, GetEntityCoords(obj), 1.5, 1.5, {
|
|
name = "codematm" .. k,
|
|
debugPoly = false,
|
|
heading = -20,
|
|
minZ = GetEntityCoords(obj).z,
|
|
maxZ = GetEntityCoords(obj).z + 2.0,
|
|
}, {
|
|
options = {
|
|
{
|
|
type = "client",
|
|
event = "codem-bank:openBankAtm",
|
|
icon = 'fas fa-credit-card',
|
|
label = "Open Atm",
|
|
},
|
|
},
|
|
distance = 8
|
|
})
|
|
end
|
|
end
|
|
Citizen.Wait(wait)
|
|
end
|
|
end)
|
|
|
|
elseif Config.InteractionHandler == "ox-target" then
|
|
|
|
for k, v in pairs(Config.BankLocations) do
|
|
exports['ox_target']:addBoxZone({
|
|
coords = vector3(v.coords.x, v.coords.y, v.coords.z),
|
|
minZ = v.coords.z - 2,
|
|
maxZ = v.coords.z + 2,
|
|
heading = -20,
|
|
name = "codembank" .. k,
|
|
options = {
|
|
{
|
|
type = "client",
|
|
event = "codem-bank:openBank",
|
|
icon = 'fas fa-credit-card',
|
|
label = "Open Bank",
|
|
},
|
|
},
|
|
})
|
|
end
|
|
|
|
for k, v in pairs(Config.ATMModels) do
|
|
options = {{
|
|
icon = 'fas fa-credit-card',
|
|
label = 'Open ATM',
|
|
event = "codem-bank:openBankAtm",
|
|
}}
|
|
distance = 1.5
|
|
exports['ox_target']:addModel(v.prop, options)
|
|
end
|
|
|
|
elseif Config.InteractionHandler == "bt-target" then
|
|
|
|
for _, v in pairs(Config.BankLocations) do
|
|
exports['bt-target']:AddBoxZone("codem-bank" .. _, v.coords, 1.25, 0.55, {
|
|
name = "codem-bank" .. _,
|
|
heading = 0.0,
|
|
debugPoly = false,
|
|
minZ = v.coords.z,
|
|
maxZ = v.coords.z + 2.0,
|
|
}, {
|
|
options = {
|
|
{
|
|
event = "codem-bank:openBank",
|
|
icon = "fa-solid fa-bank",
|
|
label = "Open Bank",
|
|
},
|
|
},
|
|
distance = 3.0,
|
|
job = {"all"}
|
|
})
|
|
end
|
|
|
|
Citizen.CreateThread(function()
|
|
while true do
|
|
local wait = 1500
|
|
local playerPed = PlayerPedId()
|
|
local coords = GetEntityCoords(playerPed)
|
|
for k, v in pairs(Config.ATMModels) do
|
|
local obj = GetClosestObjectOfType(GetEntityCoords(PlayerPedId()), 2.0, GetHashKey(v.prop))
|
|
local distance = #(coords - GetEntityCoords(obj))
|
|
if distance < 1.5 then
|
|
exports['bt-target']:AddBoxZone("codem-atm", GetEntityCoords(obj), 1.25, 0.55, {
|
|
name = "codem-atm",
|
|
heading = 0.0,
|
|
debugPoly = false,
|
|
minZ = GetEntityCoords(obj).z,
|
|
maxZ = GetEntityCoords(obj).z + 2.0,
|
|
}, {
|
|
options = {
|
|
{
|
|
event = "codem-bank:openBankAtm",
|
|
icon = "fa-solid fa-bank",
|
|
label = "Open Atm",
|
|
},
|
|
},
|
|
distance = 3.0,
|
|
job = {"all"}
|
|
})
|
|
end
|
|
end
|
|
Citizen.Wait(wait)
|
|
end
|
|
end)
|
|
|
|
elseif Config.InteractionHandler == "qtarget" then
|
|
|
|
for _, v in pairs(Config.BankLocations) do
|
|
exports["qtarget"]:AddBoxZone("codem-bank" .. _, v.coords, 1.25, 0.55, {
|
|
name = "codem-bank" .. _,
|
|
heading = 0.0,
|
|
debugPoly = false,
|
|
minZ = v.coords.z,
|
|
maxZ = v.coords.z + 2.0,
|
|
}, {
|
|
options = {
|
|
{
|
|
event = "codem-bank:openBank",
|
|
icon = "fa-solid fa-bank",
|
|
label = "Open Bank",
|
|
},
|
|
},
|
|
distance = 3.0,
|
|
job = {"all"}
|
|
})
|
|
end
|
|
|
|
Citizen.CreateThread(function()
|
|
while true do
|
|
local wait = 1500
|
|
local playerPed = PlayerPedId()
|
|
local coords = GetEntityCoords(playerPed)
|
|
for k, v in pairs(Config.ATMModels) do
|
|
local obj = GetClosestObjectOfType(GetEntityCoords(PlayerPedId()), 2.0, GetHashKey(v.prop))
|
|
local distance = #(coords - GetEntityCoords(obj))
|
|
if distance < 1.5 then
|
|
exports["qtarget"]:AddBoxZone("codem-atm", GetEntityCoords(obj), 1.25, 0.55, {
|
|
name = "codem-atm",
|
|
heading = 0.0,
|
|
debugPoly = false,
|
|
minZ = GetEntityCoords(obj).z,
|
|
maxZ = GetEntityCoords(obj).z + 2.0,
|
|
}, {
|
|
options = {
|
|
{
|
|
event = "codem-bank:openBankAtm",
|
|
icon = "fa-solid fa-bank",
|
|
label = "Open Atm",
|
|
},
|
|
},
|
|
distance = 3.0,
|
|
job = {"all"}
|
|
})
|
|
end
|
|
end
|
|
Citizen.Wait(wait)
|
|
end
|
|
end)
|
|
|
|
elseif Config.InteractionHandler == "drawtext" then
|
|
|
|
Citizen.CreateThread(function()
|
|
local isAtmOpen = false
|
|
local isBankOpen = false
|
|
while true do
|
|
local wait = 1500
|
|
local playerPed = PlayerPedId()
|
|
local coords = GetEntityCoords(playerPed)
|
|
local nearAtm = false
|
|
local nearBank = false
|
|
|
|
for k, v in pairs(Config.ATMModels) do
|
|
local obj = GetClosestObjectOfType(GetEntityCoords(PlayerPedId()), 2.0, GetHashKey(v.prop))
|
|
local distance = #(coords - GetEntityCoords(obj))
|
|
if distance < 1.5 then
|
|
wait = 0
|
|
nearAtm = true
|
|
if not isAtmOpen then
|
|
isAtmOpen = true
|
|
exports['hex_4_hud']:ShowHelpNotify("ATM benutzen", "E")
|
|
end
|
|
if IsControlJustReleased(0, 38) then
|
|
exitATM()
|
|
end
|
|
end
|
|
end
|
|
|
|
for l, s in pairs(Config.BankLocations) do
|
|
local distance2 = #(coords - s.coords)
|
|
if distance2 < 1.5 then
|
|
wait = 0
|
|
nearBank = true
|
|
if not isBankOpen then
|
|
isBankOpen = true
|
|
exports['hex_4_hud']:ShowHelpNotify("Bank benutzen", "E")
|
|
end
|
|
if IsControlJustReleased(0, 38) then
|
|
TriggerEvent('codem-bank:openBank')
|
|
end
|
|
end
|
|
end
|
|
|
|
if not nearAtm and not nearBank and (isAtmOpen or isBankOpen) then
|
|
exports['hex_4_hud']:HideHelpNotify()
|
|
isAtmOpen = false
|
|
isBankOpen = false
|
|
end
|
|
|
|
Citizen.Wait(wait)
|
|
end
|
|
end)
|
|
|
|
end
|
|
end
|
|
|
|
function DrawText3D(x, y, z, text)
|
|
local onScreen, _x, _y = World3dToScreen2d(x, y, z)
|
|
local px, py, pz = table.unpack(GetGameplayCamCoords())
|
|
SetTextScale(0.3, 0.3)
|
|
SetTextFont(4)
|
|
SetTextProportional(1)
|
|
SetTextColour(255, 255, 255, 215)
|
|
SetTextEntry("STRING")
|
|
SetTextCentre(1)
|
|
AddTextComponentString(text)
|
|
DrawText(_x, _y)
|
|
local factor = (string.len(text)) / 370
|
|
DrawRect(_x, _y + 0.0125, 0.015 + factor, 0.03, 41, 11, 41, 90)
|
|
end
|
|
|
|
Config.LoanUse = true
|
|
|
|
Config.LoanSettings = {
|
|
['loanInterest'] = 1.5,
|
|
['loanTime'] = 10,
|
|
['paymentPerDay'] = 0.05
|
|
}
|
|
|
|
Config.CertainPersonsCanUseIt = false
|
|
Config.CertainPersons = {}
|
|
|
|
Config.Loan = {
|
|
{
|
|
bankname = 'M Bank',
|
|
name = 'economy-loan',
|
|
label = 'M Economy Loan',
|
|
textcolor = '#004840',
|
|
logo = 'm-logo-blue',
|
|
loan = 50000,
|
|
smallIcon = 'm-logo-blue'
|
|
},
|
|
{
|
|
bankname = 'MAZE BANK',
|
|
name = 'premium-loan',
|
|
label = 'Maze Bank Premium Loan',
|
|
textcolor = '#500027',
|
|
logo = 'maze-logo',
|
|
loan = 100000,
|
|
smallIcon = 'maze-bank-icon'
|
|
},
|
|
{
|
|
bankname = 'MAZE BANK',
|
|
name = 'gold-loan',
|
|
label = 'Maze Bank Gold Loan',
|
|
textcolor = '#6A4600',
|
|
logo = 'maze-logo',
|
|
loan = 250000,
|
|
smallIcon = 'maze-bank-icon'
|
|
},
|
|
{
|
|
bankname = 'FLEECA BANK',
|
|
name = 'fleeca-loan',
|
|
label = 'Fleeca Bank 420 Loan',
|
|
textcolor = '#003E0B',
|
|
logo = 'fleeca-logo',
|
|
loan = 420000,
|
|
smallIcon = 'fleeca-bank-icon'
|
|
},
|
|
{
|
|
bankname = 'MAZE BANK',
|
|
name = 'diamond-loan',
|
|
label = 'Maze Bank Diamond Loan',
|
|
textcolor = '#393939',
|
|
logo = 'maze-logo',
|
|
loan = 500000,
|
|
smallIcon = 'maze-bank-icon'
|
|
},
|
|
{
|
|
bankname = 'PACIFIC BANK',
|
|
name = 'blvck-loan',
|
|
label = 'Pacific Bank BLVCK Loan',
|
|
textcolor = '#000000',
|
|
logo = 'pacific-logo',
|
|
loan = 1000000,
|
|
smallIcon = 'pacific-bank-icon'
|
|
},
|
|
}
|
|
|
|
Config.Locale = {
|
|
['ibanChange'] = 'Deine IBAN wurde geändert. Neue IBAN:',
|
|
['moneySent'] = 'Geld wurde gesendet:',
|
|
['mistakeIban'] = 'Falsche IBAN.',
|
|
['enoughMoney'] = 'Nicht genug Geld.',
|
|
['withdrawnBank'] = 'Das Geld wurde vom Bankkonto abgehoben.',
|
|
['depositedBank'] = 'Geld wurde auf das Bankkonto eingezahlt.',
|
|
['loanClosed'] = 'Kredit abgeschlossen.',
|
|
['depositedBankAccount']= 'Das Geld wurde auf dein Bankkonto eingezahlt.',
|
|
['targetSendMoney'] = 'Geld wurde gesendet.',
|
|
['billpaid'] = 'Rechnung bezahlt.',
|
|
['deleteNotify'] = 'Alle Benachrichtigungen gelöscht.',
|
|
['blockedAccount'] = 'Dein Bankkonto ist gesperrt.',
|
|
['moneyYourself'] = 'Du kannst kein Geld an dein eigenes Bankkonto senden.',
|
|
['authorised'] = 'Du bist nicht für einen Kredit berechtigt.',
|
|
['bankatm'] = 'BANK | ATM',
|
|
['pleaseinsert'] = 'Bitte Karte in den Kartenleser einführen',
|
|
['banktext'] = 'BANK',
|
|
['insert'] = 'EINFÜHREN',
|
|
['society2'] = '| GESELLSCHAFT',
|
|
['helloWelcome'] = 'Hallo, Willkommen',
|
|
['persone'] = 'Personal',
|
|
['dashboard'] = 'ÜBERSICHT',
|
|
['transaction'] = 'TRANSAKTIONEN',
|
|
['loan'] = 'KREDITE',
|
|
['bills'] = 'RECHNUNGEN',
|
|
['society3'] = 'Gesellschaft',
|
|
['exit'] = 'BEENDEN',
|
|
['changeiban'] = 'IBAN ändern',
|
|
['transfer'] = 'Überweisen',
|
|
['withdraw'] = 'Abheben',
|
|
['deposit'] = 'Einzahlen',
|
|
['clearAll'] = 'Alle löschen',
|
|
['alltransactionPage'] = 'Alle Transaktionen',
|
|
['banktext2'] = 'Bank',
|
|
['date'] = 'Datum',
|
|
['deposited'] = 'Eingezahlt',
|
|
['withdrawed'] = 'Abgehoben',
|
|
['type'] = 'TYP',
|
|
['pay'] = 'BEZAHLEN',
|
|
['notbill'] = 'Du hast keine Rechnung zu bezahlen.',
|
|
['loantext1'] = 'Du bist dabei, einen Kredit aufzunehmen.',
|
|
['loantext2'] = 'Bist du sicher?',
|
|
['yes'] = 'JA',
|
|
['no'] = 'NEIN',
|
|
['info'] = 'Info',
|
|
['loantext3'] = 'Du hast aktuell keine Kredite zu bezahlen. Du kannst unten einen Kredit auswählen.',
|
|
['myloan'] = 'Mein Kredit',
|
|
['active'] = 'Aktiv',
|
|
['loanLeft'] = 'Verbleibender Kredit',
|
|
['warning'] = 'Warnung',
|
|
['loantext4'] = 'Wenn das Fälligkeitsdatum deines Kredits abgelaufen ist, wird die Bank den Kreditbetrag automatisch von deinem Konto abbuchen. Bitte beachte dies!',
|
|
['payment'] = 'Zahlung',
|
|
['aloan'] = 'Verfügbare Kredite',
|
|
['loanprice'] = 'Kreditbetrag',
|
|
['information'] = 'INFORMATION',
|
|
['infotext1'] = 'Du bist noch keiner Gesellschaft beigetreten. Wenn du bei einem Unternehmen oder einer Behörde arbeitest, gib bitte den "GESELLSCHAFTS-CODE" deines Unternehmens oder deiner Behörde an. Danke!',
|
|
['infotext2'] = 'Hast du einen Gesellschafts-Code? Tritt deiner Gesellschaft jetzt bei!',
|
|
['joinSoc'] = 'Gesellschaft beitreten',
|
|
}
|
|
|
|
Config.Notifications = {
|
|
["nomoney"] = {
|
|
message = 'FEHLER!!! Auf die Jobdaten konnte nicht zugegriffen werden.',
|
|
type = "success",
|
|
},
|
|
["minRequired"] = {
|
|
message = 'Du musst mindestens zahlen: ',
|
|
type = "success",
|
|
},
|
|
['youHave'] = {
|
|
message = 'Du hast einen Betrag deines Kredits bezahlt: $',
|
|
type = "success",
|
|
},
|
|
['payLoan'] = {
|
|
message = 'Bitte bezahle deinen Kredit',
|
|
type = "success",
|
|
}
|
|
}
|
|
|
|
Config.Notification = function(message, type, isServer, src)
|
|
if isServer then
|
|
if Config.Framework == "newesx" or Config.Framework == "oldesx" then
|
|
TriggerClientEvent("hex_4_hud:Notify", src, nil, message, type or "info", 3000)
|
|
else
|
|
TriggerClientEvent("hex_4_hud:Notify", src, nil, message, type or "info", 3000)
|
|
end
|
|
else
|
|
exports['hex_4_hud']:Notify(nil, message, type or "info", 3000)
|
|
end
|
|
end
|
|
|
|
function GetIdentifier(source)
|
|
if Config.Framework == "newesx" or Config.Framework == "oldesx" then
|
|
local xPlayer = frameworkObject.GetPlayerFromId(tonumber(source))
|
|
if xPlayer then
|
|
return xPlayer.getIdentifier()
|
|
else
|
|
return "0"
|
|
end
|
|
else
|
|
local Player = frameworkObject.Functions.GetPlayer(tonumber(source))
|
|
if Player then
|
|
return Player.PlayerData.citizenid
|
|
else
|
|
return "0"
|
|
end
|
|
end
|
|
end
|
|
|
|
function GetName(source)
|
|
if Config.Framework == "newesx" or Config.Framework == "oldesx" then
|
|
local xPlayer = frameworkObject.GetPlayerFromId(tonumber(source))
|
|
if xPlayer then
|
|
return xPlayer.getName()
|
|
else
|
|
return "0"
|
|
end
|
|
else
|
|
local Player = frameworkObject.Functions.GetPlayer(tonumber(source))
|
|
if Player then
|
|
return Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname
|
|
else
|
|
return "0"
|
|
end
|
|
end
|
|
end |