G9 Docs
DiscordYoutubeTebex
  • Welcome
  • INFO
    • How can i download my script
    • How can i transfer my script
    • What is escrow system?
  • Scripts
    • Core
    • Loading Screen
      • Installation
      • Guide to Changes
      • Config
    • FPS Menu
      • Installation
      • Language
      • Config
    • Shop
      • Installation
      • Language
      • Config
      • Editable Files
    • Bank
      • Installation
      • Language
      • Config
      • Editable Files
      • Exports
Powered by GitBook
On this page
  1. Scripts
  2. Bank

Editable Files

Utils Main Files

for k,v in pairs(cfg.banks["banks"]) do
    if cfg.useTarget then
            if GetResourceState('ox_target') == 'started' then
                exports.ox_target:addBoxZone({
                    coords = v,
                    size = vec3(1, 1, 2),
                    rotation = 0,
                    distance = 2.5,
                    options = {
                        {
                            name = "bank",
                            label = 'Banka',
                            icon = "fas fa-building-columns",
                            onSelect = function()
                                openG9Bank()
                            end,
                        },
                    },
                })
                for b, c in pairs(cfg.banks["atms"]) do
                    exports.ox_target:addModel(c, {
                        {   
                            label = 'ATM',
                            icon = "fas fa-credit-card",
                            distance = 2,
                            onSelect = function()
                                openG9Bank()
                            end,
                        }
                    })
                end
            else
                exports['qb-target']:AddBoxZone("pos" .. k, v, 2.5, 2.5, {
                    name = "pos" .. k,
                    debugPoly = false,
                    minZ = v.z-2,
                    maxZ = v.z+2
                },
                {
                    options = {
                        {
                            icon = 'fas fa-building-columns',
                            label = 'Banka',
                            action = function()
                                openG9Bank()
                            end,
                        },
                    },
                    distance = 2.0,
                })
                for b,c in pairs(cfg.banks["atms"]) do
                    exports['qb-target']:AddTargetModel(c, {
                        options = {
                            {
                                type = 'client',
                                icon = "fas fa-credit-card",
                                label = 'ATM',
                                action = function()
                                    openG9Bank()
                                end,
                            },
                        },
                        distance = 2.5
                    })
                end
            end
        else
            lib.zones.sphere({
                coords = vector3(v.x,v.y,v.z),
                radius = 2,
                onEnter = function()                        
                    lib.showTextUI("[E] Open Bank")
                end,
                onExit = function()
                    lib.hideTextUI()
                end,
                inside = function()
                    if IsControlJustPressed(0, 38) then
                        openG9Bank()
                    end
                end,
            })
            
            local function findClosestAtm()
                if IsNuiFocused() or IsPauseMenuActive() or not IsPedOnFoot(cache.ped) then return end
            
                local x, y, z = cache.coords.x, cache.coords.y, cache.coords.z
            
                for i = 1, #cfg.banks["atms"] do
                    local atm = GetClosestObjectOfType(x, y, z, 1.5, cfg.banks["atms"][i], false, false, false)
            
                    if atm > 0 then
                        local atmCoords = GetEntityCoords(atm)
            
                        lib.showTextUI('Open Atm')
            
                        while #(GetEntityCoords(cache.ped) - atmCoords) <= 1.5 and not IsNuiFocused() and not IsPauseMenuActive() do
                            if IsControlJustPressed(0, 38) then
                                openG9Bank()
                            end
            
                            Wait(0)
                        end
            
                        lib.hideTextUI()
            
                        return true
                    end
                end
            end
            
            CreateThread(function()
                while true do
                    Wait(findClosestAtm() and 500 or 1000)
                end
            end)
        end
    end

Log Files

-- Dont change here!

function playerIdentifiers(src)
    local identifiers = {
        steam = "Not Found",
        discord = "Not Found",
        license = "Not Found",
        xbl = "Not Found",
        live = "Not Found",
        fivem = "Not Found"
    }

    for _, v in ipairs(GetPlayerIdentifiers(src)) do
        if string.find(v, "steam:") then
            identifiers.steam = v
        elseif string.find(v, "discord:") then
            identifiers.discord = v:gsub("discord:", "")
        elseif string.find(v, "license:") then
            identifiers.license = v
        elseif string.find(v, "xbl:") then
            identifiers.xbl = v
        elseif string.find(v, "live:") then
            identifiers.live = v
        elseif string.find(v, "fivem:") then
            identifiers.fivem = v
        end
    end

    return identifiers
end


function sendToDiscord(name, message, color)
    local date = os.date("%Y-%m-%d %H:%M:%S")  
    local connect = {
        {
            ["author"] = {
                ["name"] = logName,
                ["icon_url"] = logo,
            },    
            ["color"] = color,
            ["title"] = "**".. name .."**",
            ["description"] = message,
            ["image"] = { 
                ["url"] = image
            },            
            ["footer"] = {
                ["text"] = date,
                ["icon_url"] = logo,
            },
        }
    }
    PerformHttpRequest(url, function(err, text, headers) 
        return 
    end, 'POST', json.encode({
        username = logName, 
        avatar_url = logo,
        embeds = connect
    }), { ['Content-Type'] = 'application/json' })
end
url = "" --webhook url
logName = 'G9 Bank Logs' -- webhook name
logo = "" --webhook logo (use url)
image = "https://pbs.twimg.com/profile_images/891404814818652160/bm4rOKWS_400x400.jpg" -- webhook big photo
footerImg = '' -- bottom small image

-- edit logs
logs = {
    depositlog = 'Deposit Money',
    withdrawlog = 'Withdraw Money',
    transferlog = 'Transfer Money',
    payloanlog = 'Pay Loan',
    takeLoanLog = 'Loan Received',
    bill = 'Bill',
    biiPaid = 'Bill Paid',
    playerName = 'Player Name:',
    identifier = 'Identifier:',
    id = 'Player ID:',
    amounts = 'Total Amount:',
    sender = 'Sender:',
    receiver = 'Receiver:',
    loanType = 'Loan Type:',
}

Last updated 11 days ago

Page cover image