⚙️CONFIG FILES

chevron-rightMain Confighashtag
Config = {}

Config.Framework = 'ESX' -- ESX / QBCORE (NOT FINISHED AT THIS MOMENT) / CUSTOM (if custom go to framework folder and add ur exports)

Config.Apps = {
    ['camera'] = true, -- true = app is shown default, false = need to be added by export
    ['gallery'] = true,
    ['bank'] = true,
    ['jobs'] = true,
    ['garage'] = true,
    ['twitter'] = true,
    ['yellowpages'] = true,
    ['center'] = true,
    ['drivenow'] = true,
    ['magazines'] = true,
    ['racing'] = true,
    ['delivery'] = true,
    ['crackit'] = true,
    ['crypto'] = true,
    ['onion'] = true,
    ['crime'] = true,
    ['music'] = false, -- dont touch
}

Config.Wallpapers = {
    ['img/wallpapers/Wallpaper-1.png'] = 'Default', -- dont touch this (you can only change wallpaper file and rename it to Wallpaper-1.png)
    ['img/wallpapers/Wallpaper-2.png'] = 'Space',
    ['img/wallpapers/Wallpaper-3.png'] = 'Squares',
    ['img/wallpapers/Wallpaper-5.png'] = 'Poly',
}

Config.Ringtones = {
    ['sounds/ringtone.mp3'] = 'Default', -- dont touch this (you can only change sound file and rename it to ringtone.mp3)
    ['sounds/ringtone2.mp3'] = 'Marimba',
    ['sounds/ringtone3.mp3'] = 'Waves',
    ['sounds/ringtone4.mp3'] = 'Tropical',
}

Config.Notify = {
    ['sounds/message.mp3'] = 'Default' -- dont touch this (you can only change sound file and rename it to message.mp3)
}

Config.Outlines = {
    ['#020609'] = 'Basic', -- dont touch this
    ['#120411'] = 'Pink',
    ['#040912'] = 'Blue',
    ['#140404'] = 'Red'
}

Config.PhoneTime = 'real' -- real / game

Config.AirDropCooldown = 10 -- seconds

Config.DisableMovement = function()
    lib.disableControls:Add({0, 1, 2, 24, 25, 26, 73, 85, 167, 170, 199, 257, 263, 289})
    LocalPlayer.state.invBusy = true
    LocalPlayer.state.invHotkeys = false
    LocalPlayer.state.canUseWeapons = false
    -- you can add more
end

Config.EnableMovement = function()
    lib.disableControls:Clear({0, 1, 2, 24, 25, 26, 73, 85, 167, 170, 199, 257, 263, 289})
    LocalPlayer.state.invBusy = false
    LocalPlayer.state.invHotkeys = true
    LocalPlayer.state.canUseWeapons = true
    -- you can add more
end

Config.Prop = 'prop_npc_phone' -- prop_npc_phone / prop_npc_phone_02 / prop_cs_phone_01 / other

-- dont touch this
function Language(app)
    return Config.Language[app]
end
chevron-rightBanking Confighashtag
Config.Bank = {}

Config.Bank.Society = { -- which jobs and from which grade will have society account in bank app
    ['police'] = {
        [15] = true
    }
}

Config.Bank.fetchAccounts = function(source)
    local xPlayer = Phone.GetPlayerFromId(source)
    local accounts = {
        {
            name = xPlayer.getName(),
            number = xPlayer.get('accNumber'),
            money = xPlayer.getAccount('bank').money,
            history = Config.Bank.fetchHistory(source, xPlayer.get('accNumber'))
        }
    }

    local playerJob = xPlayer.getJob()
    local await = false
    if Config.Bank.Society[playerJob.name] and Config.Bank.Society[playerJob.name][playerJob.grade] then
        TriggerEvent('esx_addonaccount:getSharedAccount', 'society_'..playerJob.name, function(account)
            if account then
                await = true
                local accountHistory = Config.Bank.fetchHistory(source, account.number)
                accounts[#accounts + 1] = {
                    name = account.label,
                    number = account.number,
                    money = account.money,
                    history = accountHistory
                }
                Citizen.Wait(200)
                await = false
            end
        end)
    end

    while await do
        Wait(100)
    end

    return accounts
end

Config.Bank.fetchHistory = function(source, number)
    local sortedHistory = {}
    local History = MySQL.query.await('SELECT * FROM bank_history WHERE number = ? ORDER by id DESC LIMIT 20', {number})
    for i = 1, #History, 1 do
        local newHistory = {} -- sender_name / sender / type / amount / time
        local accExist = exports['piotreq_banking']:AccExist(History[i].sender)
        if accExist then
            newHistory.sender_name = accExist.acc.firstname and accExist.acc.firstname..' '..accExist.acc.lastname or accExist.acc.label
            newHistory.sender = History[i].sender
        else
            newHistory.sender_name = 'SYSTEM'
            newHistory.sender = '0000000'
        end
        newHistory.type = History[i].type -- 1 = Incoming / 2 Outgoing
        newHistory.amount = History[i].amount
        newHistory.time = os.date('%d/%m/%y %H:%M', History[i].time)
        table.insert(sortedHistory, newHistory)
    end
    return sortedHistory
end

lib.callback.register('piotreq_phone:SendTransfer', function(source, data)
    local xPlayer = Phone.GetPlayerFromId(source)
    local amount = tonumber(data.amount)
    local returnData = nil
    if (amount > 0) then
        local accExist = exports['piotreq_banking']:AccExist(data.number)
        local myAccount = exports['piotreq_banking']:AccExist(data.myNumber)
        if accExist and myAccount then
            if (accExist.type == 'player' and myAccount.type == 'player') then
                if (accExist.acc.identifier ~= xPlayer.identifier) then
                    local xTarget = ESX.GetPlayerFromIdentifier(accExist.acc.identifier)
                    if xTarget then
                        if xPlayer.getAccount('bank').money >= amount then
                            xPlayer.removeAccountMoney('bank', amount, data.title, data.number)
                            xTarget.addAccountMoney('bank', amount, data.title, data.myNumber)
                            TriggerClientEvent('piotreq_phone:SendNotification', xTarget.source, {
                                type = 'bank',
                                title = 'Transfer',
                                time = 'Now',
                                text = 'You got transfer $'..amount,
                                timeout = 5000
                            })
                            returnData = {
                                sender_name = xTarget.getName(), 
                                money = xPlayer.getAccount('bank').money, 
                                time = 'Right now'
                            }
                        else
                            returnData = {type = 'error', text = 'You dont have enough money'}
                        end
                    else
                        local result = MySQL.single.await('SELECT firstname, lastname, accounts FROM users WHERE identifier = ?', {accExist.acc.identifier})
                        if result and result.accounts then
                            local accounts = json.decode(result.accounts)
                            accounts.bank = tonumber(accounts.bank + amount)
                            xPlayer.removeAccountMoney('bank', amount, data.title, data.number)
                            MySQL.update('UPDATE users SET accounts = ? WHERE identifier = ?', {json.encode(accounts)})
                            returnData = {
                                sender_name = result.firstname..' '..result.lastname, 
                                money = xPlayer.getAccount('bank').money, 
                                time = 'Right now'
                            }
                        end
                    end
                else
                    returnData = {type = 'error', text = 'You cant transfer money to urself'}
                end
            else
                if myAccount.type == 'player' and accExist.type == 'society' then
                    TriggerEvent('esx_addonaccount:getSharedAccount', accExist.acc.name, function(account)
                        if account then
                            if xPlayer.getAccount('bank').money >= amount then
                                xPlayer.removeAccountMoney('bank', amount, data.title, data.number)
                                account.addMoney(amount, data.title, data.myNumber)
                                returnData = {
                                    sender_name = accExist.acc.label, 
                                    money = xPlayer.getAccount('bank').money, 
                                    time = 'Right now'
                                }
                            else
                                returnData = {type = 'error', text = 'You dont have enough money'}
                            end
                        else
                            returnData = {type = 'error', text = 'Account with this number doesnt exist'}
                        end
                    end)
                elseif myAccount.type == 'society' and accExist.type == 'society' then
                    TriggerEvent('esx_addonaccount:getSharedAccount', accExist.acc.name, function(account)
                        if account then
                            TriggerEvent('esx_addonaccount:getSharedAccount', myAccount.acc.name, function(account2)
                                if account2 then
                                    if account2.money >= amount then
                                        account2.removeMoney(amount, data.title, data.number)
                                        account.addMoney(amount, data.title, data.myNumber)
                                        returnData = {
                                            sender_name = accExist.acc.label, 
                                            money = account.money, 
                                            time = 'Right now'
                                        }
                                    else
                                        returnData = {type = 'error', text = 'You dont have enough money'}
                                    end
                                else
                                    returnData = {type = 'error', text = 'Account doesnt exist'}
                                end
                            end)
                        else
                            returnData = {type = 'error', text = 'Account doesnt exist'}
                        end
                    end)
                elseif myAccount.type == 'society' and accExist.type == 'player' then
                    local xTarget = ESX.GetPlayerFromIdentifier(accExist.acc.identifier)
                    if xTarget then
                        TriggerEvent('esx_addonaccount:getSharedAccount', myAccount.acc.name, function(account)
                            if account then
                                if account.money >= amount then
                                    account.removeMoney(amount, data.title, data.number)
                                    xTarget.addAccountMoney('bank', amount, data.title, data.myNumber)
                                    TriggerClientEvent('piotreq_phone:SendNotification', xTarget.source, {
                                        type = 'bank',
                                        title = 'Transfer',
                                        time = 'Now',
                                        text = 'You got transfer $'..amount,
                                        timeout = 5000
                                    })
                                    returnData = {
                                        sender_name = xTarget.getName(), 
                                        money = account.money, 
                                        time = 'Right now'
                                    }
                                else
                                    returnData = {type = 'error', text = 'You dont have enough money'}
                                end
                            else
                                returnData = {type = 'error', text = 'Account doesnt exist'}
                            end
                        end)
                    else
                        TriggerEvent('esx_addonaccount:getSharedAccount', myAccount.acc.name, function(account)
                            if account then
                                if account.money >= amount then
                                    local result = MySQL.single.await('SELECT firstname, lastname, accounts FROM users WHERE identifier = ? LIMIT 1', {accExist.acc.identifier})
                                    if result and result.accounts then
                                        local accounts = json.decode(result.accounts)
                                        accounts.bank = tonumber(accounts.bank + amount)
                                        account.removeMoney(amount, data.title, data.number)
                                        MySQL.update('UPDATE users SET accounts = ? WHERE identifier = ?', {json.encode(accounts)})
                                        returnData = {
                                            sender_name = result.firstname..' '..result.lastname, 
                                            money = xPlayer.getAccount('bank').money, 
                                            time = 'Right now'
                                        }
                                    end
                                else
                                    returnData = {type = 'error', text = 'You dont have enough money'}
                                end
                            else
                                returnData = {type = 'error', text = 'Account doesnt exist'}
                            end
                        end)
                    end
                end
            end
        else
            returnData = {type = 'error', text = 'Account doesnt exist'}
        end
    else
        returnData = {type = 'error', text = 'Amount need to be higher than 0'}
    end

    while returnData == nil do
        Wait(50)
    end

    return returnData
end)
chevron-rightCrypto Confighashtag
Config.Crypto = {}

Config.Crypto.Logs = true -- true | false

Config.Crypto.Currencies = {
    ['sultanium'] = { -- account name
        label = 'SLT',
        exchange = 250, -- 1 crypto = 250 $
        icon = 'img/home/slt.png'
    }
}

Config.Crypto.Format = 6 -- 6 digits wallet
chevron-rightCrime Confighashtag
Config.Crime = {}

Config.Crime.Levels = {
    [1] = 0, -- 1 level is default, leave it on 0
    [2] = 1000,
    [3] = 1000,
    [4] = 1000,
    [5] = 1000,
}

Config.Crime.Limit = 4 -- max 4 members in group

Config.Crime.FirstNames = {
    "James", "Mary", "John", "Patricia", "Robert", "Jennifer", "Michael", "Linda", 
    "William", "Elizabeth", "David", "Barbara", "Richard", "Susan", "Joseph", "Jessica", 
    "Thomas", "Sarah", "Charles", "Karen", "Christopher", "Nancy", "Daniel", "Lisa", 
    "Matthew", "Betty", "Anthony", "Margaret", "Donald", "Sandra", "Mark", "Ashley", 
    "Paul", "Kimberly", "Steven", "Emily", "Andrew", "Donna", "Kenneth", "Michelle", 
    "Joshua", "Dorothy", "Kevin", "Carol", "Brian", "Amanda", "George", "Melissa", 
    "Edward", "Deborah", "Ronald", "Stephanie", "Timothy", "Rebecca", "Jason", "Laura", 
    "Jeffrey", "Sharon", "Ryan", "Cynthia", "Jacob", "Kathleen", "Gary", "Amy", 
    "Nicholas", "Shirley", "Eric", "Angela", "Jonathan", "Helen", "Stephen", "Anna", 
    "Larry", "Brenda", "Justin", "Pamela", "Scott", "Nicole", "Brandon", "Emma", 
    "Benjamin", "Samantha", "Samuel", "Katherine", "Gregory", "Christine", "Frank", 
    "Debra", "Alexander", "Rachel", "Raymond", "Catherine", "Patrick", "Carolyn", 
    "Jack", "Janet", "Dennis", "Ruth", "Jerry", "Maria"
}

Config.Crime.LastNames = {
    "Smith", "Johnson", "Williams", "Brown", "Jones", "Garcia", "Miller", "Davis", 
    "Rodriguez", "Martinez", "Hernandez", "Lopez", "Gonzalez", "Wilson", "Anderson", 
    "Thomas", "Taylor", "Moore", "Jackson", "Martin", "Lee", "Perez", "Thompson", 
    "White", "Harris", "Sanchez", "Clark", "Ramirez", "Lewis", "Robinson", "Walker", 
    "Young", "Allen", "King", "Wright", "Scott", "Torres", "Nguyen", "Hill", 
    "Flores", "Green", "Adams", "Nelson", "Baker", "Hall", "Rivera", "Campbell", 
    "Mitchell", "Carter", "Roberts", "Gomez", "Phillips", "Evans", "Turner", 
    "Diaz", "Parker", "Cruz", "Edwards", "Collins", "Reyes", "Stewart", "Morris", 
    "Morales", "Murphy", "Cook", "Rogers", "Gutierrez", "Ortiz", "Morgan", 
    "Cooper", "Peterson", "Bailey", "Reed", "Kelly", "Howard", "Ramos", "Kim", 
    "Cox", "Ward", "Richardson", "Watson", "Brooks", "Chavez", "Wood", "James", 
    "Bennett", "Gray", "Mendoza", "Ruiz", "Hughes", "Price", "Alvarez", "Castillo", 
    "Sanders", "Patel", "Myers", "Long", "Ross", "Foster", "Jimenez"
}
chevron-rightContacts Confighashtag
Config.Contacts = {}

Config.Contacts.Logs = false -- true | false
chevron-rightCrackIT Confighashtag
Config.CrackIT = {}

Config.CrackIT.Action = function()
    local entity, dist = ESX.Game.GetClosestVehicle()
    if entity ~= 0 and dist < 3 and not IsPedSittingInAnyVehicle(cache.ped) then
        return {
            action = 'VehicleHack', wifi = 4, maxWifiFails = 4, entity = entity, hack = 'simon', 
            hint = 'Remember moves and repeat', settings = {need = 5, time = 10000}
        }
        -- return {
        --     action = 'VehicleHack', wifi = 4, maxWifiFails = 4, entity = entity, hack = 'aim', 
        --     hint = 'Klikaj jak najszybciej podświetlone kwadraty', settings = {need = 15, failOnBad = true, max = 5, generate = 350}
        -- }
    end
end

Config.CrackIT.Finish = function(data)
    if data.action == 'VehicleHack' then
        if data.result then -- if win
            SetVehicleDoorsLocked(data.entity, 1) -- unlock vehicle
            SetVehicleDoorsLockedForAllPlayers(data.entity, false) -- unlock vehicle
            ESX.ShowNotification('You opened vehicle doors') -- show notify
        else
            ESX.ShowNotification('You failed to open vehicle') -- if not win notify
        end

        return
    end
end
chevron-rightCenter Confighashtag
chevron-rightCalls Confighashtag
chevron-rightDeliveries Confighashtag
chevron-rightDrivenow Confighashtag
chevron-rightGarages Confighashtag
chevron-rightJobs Confighashtag
chevron-rightMagazines Confighashtag
chevron-rightMessages Confighashtag
chevron-rightMusic Confighashtag
chevron-rightOnion Confighashtag
chevron-rightRacing Confighashtag
chevron-rightSimcards Confighashtag
chevron-rightTwitter Confighashtag
chevron-rightWebhooks Confighashtag
chevron-rightYellowpages Confighashtag

Last updated