Page cover
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Accessible files

Here you can find all the files which can be edite to make the asset compatible with your server.​

config.lua
----------------------------------------------------------------------------------------------
-----------------------------------| BRUTAL ATM ROBBERY :) |----------------------------------
----------------------------------------------------------------------------------------------

--[[
Hi, thank you for buying our script, We are very grateful!

For help join our Discord server:     https://discord.gg/85u2u5c8q9
More informations about the script:   https://docs.brutalscripts.com
--]]

Config = {
    Core = 'ESX',  -- 'ESX' / 'QBCORE' | Other core setting on the 'core' folder.
    BrutalNotify = true, -- Buy here: (4€+VAT) https://store.brutalscripts.com | Or set up your own notify >> cl_utils.lua
    BrutalGangs = true, -- Buy here: (35€+VAT) https://store.brutalscripts.com | Or set up your own if you're using a different gang script >> sv_utils.lua
    
    NextRobbery = 5,  -- minutes
    Item = 'drill',
    UseDrillCommand = {use = true, command = 'atmdrill'},
    Models = {'prop_atm_03', 'prop_fleeca_atm', 'prop_atm_02'},
    RequiredCopsCount = 0,
    BagType = 45,
    CopJobs = {'police', 'sheriff', 'fbi'},
    BlipTime = 2, -- minutes
    Reward = {Min = 10000, Max = 20000}, -- BLACK MONEY IS CONFIGURABLE IN THE core/server-core.lua!
    Blip = { label = 'ATM Robbery', size = 1.0, sprite = 161, colour = 1},
    MoneySymbol = '$',

    -- Notify function EDITABLE >> cl_utils.lua
    Notify = {
        [1] =  {'ATM Robbery', "Robbery Failed!", 5000, 'info'},
        [2] =  {'ATM Robbery', "There is an ATM robbery in the City! Marked on the map!", 5000, 'info'},
        [3] =  {'ATM Robbery', "Not enough Cops in the City!", 5000, 'error'},
        [4] =  {'ATM Robbery', "You can't start the robbery now!", 5000, 'error'},
        [5] =  {'ATM Robbery', "You have got", 5000, 'info'},
        [6] =  {'ATM Robbery', "Do not spam!", 5000, 'error'},
    }
}
client-utils.lua
-- Buy here: (4€+VAT) https://store.brutalscripts.com
function notification(title, text, time, type)
    if Config.BrutalNotify then
        exports['brutal_notify']:SendAlert(title, text, time, type)
    else
        -- Put here your own notify and set the Config.BrutalNotify to false
        SetNotificationTextEntry("STRING")
        AddTextComponentString(text)
        DrawNotification(0,1)

        -- Default ESX Notify:
        --TriggerEvent('esx:showNotification', text)

        -- Default QB Notify:
        --TriggerEvent('QBCore:Notify', text, 'info', 5000)

        -- OKOK Notify:
        -- exports['okokNotify']:Alert(title, text, time, type, false)

    end
end

RegisterNetEvent('brutal_atm_robbery:client:PoliceAlertBlip')
AddEventHandler('brutal_atm_robbery:client:PoliceAlertBlip', function(coords)

    -- notify function
    notification(Config.Notify[2][1], Config.Notify[2][2], Config.Notify[2][3], Config.Notify[2][4])
    
    -- blip for the cops
    AlertAtm = AddBlipForCoord(coords.x, coords.y, coords.z)
    SetBlipSprite(AlertAtm, Config.Blip['sprite'])
    SetBlipScale(AlertAtm, Config.Blip['size'])
    SetBlipColour(AlertAtm, Config.Blip['colour'])
    BeginTextCommandSetBlipName('STRING')
    AddTextComponentSubstringPlayerName(Config.Blip['label'])
    EndTextCommandSetBlipName(AlertAtm)

    Citizen.Wait(1000*60*Config.BlipTime)
    RemoveBlip(AlertAtm)
end)
server-utils.lua
local YourWebhook = 'WEBHOOK-HERE'  -- help: https://docs.brutalscripts.com/site/others/discord-webhook

function GetWebhook()
    return YourWebhook
end

RegisterServerEvent("brutal_atm_robbery:server:PoliceAlert")
AddEventHandler("brutal_atm_robbery:server:PoliceAlert", function(coords)
    local source = source
	local xPlayers = GetPlayersFunction()
	
	for i=1, #xPlayers, 1 do
        for ii=1, #Config.CopJobs do
            if GetPlayerJobFunction(xPlayers[i]) == Config.CopJobs[ii] then
            TriggerClientEvent("brutal_atm_robbery:client:PoliceAlertBlip", xPlayers[i], coords)
            end
        end
    end
end)

function GiveGangRewards(source, job)
    if Config.BrutalGangs and GetResourceState("brutal_gangs") == "started" then 
        local gangname = exports["brutal_gangs"]:GetPlayerGangName(source)

        if gangname then
            exports['brutal_gangs']:AddGangReputation(gangname, 5000)
            exports['brutal_gangs']:AddGangMoney(gangname, 5000)
        end
    end    
end
client-core.lua
Core = nil

if Config['Core']:upper() == 'ESX' then
    
    local _esx_ = 'new' -- 'new' / 'old'

    if _esx_ then
        Core = exports['es_extended']:getSharedObject()
    else
        while Core == nil do
            TriggerEvent('esx:getSharedObject', function(obj) Core = obj end)
            Citizen.Wait(0)
        end
    end
    
    TSCB = Core.TriggerServerCallback
    PlayerDiedHealth = 0

elseif Config['Core']:upper() == 'QBCORE' then

    Core = exports['qb-core']:GetCoreObject()
    TSCB = Core.Functions.TriggerCallback
    PlayerDiedHealth = 100

end
server-core.lua
Core = nil

if Config.Core:upper() == 'ESX' then
--------------------------------------------------------------------------
---------------------------------| ESX |----------------------------------
--------------------------------------------------------------------------

    local _esx_ = 'new' -- 'new' / 'old'
            
    if _esx_ == 'new' then
        Core = exports['es_extended']:getSharedObject()
    else
        Core = nil
        TriggerEvent('esx:getSharedObject', function(obj) Core = obj end)
        while Core == nil do
            Citizen.Wait(0)
        end
    end

    RESCB = Core.RegisterServerCallback
    GETPFI = Core.GetPlayerFromId
    RUI = Core.RegisterUsableItem

    function GetPlayersFunction()
        return Core.GetPlayers()
    end

    function AddMoneyFunction(source, amount)
        local xPlayer = GETPFI(source)

        xPlayer.addAccountMoney('money', amount) -- NORMAL MONEY
        --xPlayer.addAccountMoney('black_money', amount) -- BLACK MONEY
    end

    function GetPlayerJobFunction(source)
        if source ~= nil then
            local xPlayer = GETPFI(source)
            PlayerJob = xPlayer.job.name
            return PlayerJob
        else
            return "none"
        end
    end

    function RemoveItem(source, item, amount)
        local xPlayer = GETPFI(source)
        xPlayer.removeInventoryItem(item, amount)
    end

    function GetIdentifierFunction(source)
        local xPlayer = GETPFI(source)
        return xPlayer.identifier
    end

elseif Config.Core:upper() == 'QBCORE' then
--------------------------------------------------------------------------
--------------------------------| QBCORE |--------------------------------
--------------------------------------------------------------------------

    Core = exports['qb-core']:GetCoreObject()
    
    RESCB = Core.Functions.CreateCallback
    GETPFI = Core.Functions.GetPlayer
    RUI = Core.Functions.CreateUseableItem

    function GetPlayersFunction()
        return Core.Functions.GetPlayers()
    end

    function AddMoneyFunction(source, amount)
        local xPlayer = GETPFI(source)
        xPlayer.Functions.AddMoney('cash', amount)
    end

    function GetPlayerJobFunction(source)
        local xPlayer = GETPFI(source)
        PlayerJob = xPlayer.PlayerData.job.name
        return PlayerJob
    end

    function RemoveItem(source, item, amount)
        local xPlayer = GETPFI(source)
        xPlayer.Functions.RemoveItem(item, amount)
    end

    function GetIdentifierFunction(source)
        local xPlayer = GETPFI(source)
        return xPlayer.PlayerData.citizenid
    end
    
end

Last updated