Accessible files

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

config.lua
Config = {
    Core = 'ESX',  -- ESX / QBCORE | Other core setting on the 'core' folder and the client and server utils.lua
    BrutalNotify = true, -- Buy here: (4€+VAT) https://store.brutalscripts.com | Or set up your own notify >> cl_utils.lua
    TextUI = 'ox_lib', -- 'ox_lib' / 'okokTextUI' / 'ESXTextUI' / 'QBDrawText' // Custom can be add in the cl_utils.lua!!!
    CopsJobs = {'police', 'fbi'}, -- Add the cops jobs
    RequiredCopsCount = 0, -- This is how many cops are needed to be in the server to start a heist
    Cooldown = 60, -- The time between robberies | in minutes
    MaxDistance = 120, -- The heist ends after this distance.
    DisableControls = {170,168,24,257,25,263,32,34,31,30,45,22,44,23,288,289,170,167,73,199,59,71,72,36,47,264,257,140,141,142,143,75},
    
    MHacking = {
        Characters = 7, -- How many characters you have to find in each lines
        Time = 20 -- How much time you have for the hacking
    },

    Items = {
        HackingItem = {remove = false, item = 'hacking_device'},
        DrillingItem = {remove = false, item = 'yacht_drill'}, -- It cannot be the same as the "drill" item used in other robberies.
    },

    Coords = {
        Start = vector3(-2031.4377, -1038.0327, 2.5636),
        KeypadCoords = vector3(-2069.735595, -1020.0855, 6.444),
        SafeHacking = vector3(-2070.3191, -1019.8993, 5.4842),
        SafeDoorCoords = vector3(-2069.56, -1019.29, 6.0424),
    },

    ItemsSellToBoss = {
        use = true, -- Use item sell functions? | you can use your custom too
        availableTime = 30, -- in minutes [That's how long the player have to deliver the items after the heist]
        coords = vector4(-274.8105, 167.8665, 77.9090, 84.9507), -- Sell coords
        model = 'a_m_m_eastsa_01', -- Sell NPC model
        blip = {use = true, label = 'Items Sell', size = 0.9, sprite = 500, color = 2}, -- Sell Blip
        ItemPrices = {
            {item = "gold", label = "Gold", sellprice = 2000},
            {item = "diamond", label = "Diamond", sellprice = 5000},
            {item = "whiskey", label = "Whisky", sellprice = 700}, 
            {item = "laptop", label = "Laptop", sellprice = 700},
            {item = "laptop", label = "Laptop", sellprice = 700},
            {item = "gold_award", label = "Gold Award", sellprice = 700},
            {item = "drug_pack", label = "Drug Pack", sellprice = 700},
            {item = "painting", label = "Painting", sellprice = 700},
            {item = "painting", label = "Painting", sellprice = 700},
        }
    },

    Blips = {
        HeistBlip = {Use = true, label = 'Yacht Heist', size = 0.8, sprite = 455, color = 62},
        PoliceAlertBlip = {label = 'Yacht Heist', size = 1.0, sprite = 161, color = 1},
        SafeHackBlip = {Use = false, label = 'Hack the safe', size = 0.8, sprite = 156, color = 62},
    },

    Markers = {
        SafeHacking = {use = true, marker = 20, rgb = {233, 88, 69}, bobUpAndDown = false, rotate = false},
        LockBoxes = {use = true, marker = 20, rgb = {233, 88, 69}, bobUpAndDown = false, rotate = false},
        Trolleys = {use = true, marker = 20, rgb = {233, 88, 69}, bobUpAndDown = false, rotate = false},
    },

    SafeHackingPreset = {
        Levels = 3, -- levels is how many levels you want. Max is 4, Min is 1
        Lifes = 4,  -- lifes is how many life player has, Max is 6, Min is 1
        Time = 3, -- time is how much time player has in minutes, Max is 9, min is 1 (I highly recommend to set it between 3-1)
    },

    LockerChanceforReward = 50, -- in percentages 
    LockerRewards = {
        {item = 'gold', label = 'Gold', count = {5, 10}},
        {item = 'diamond', label = 'Diamond', count = {5, 10}},
    },

    TrollyReward = {item = "money", label = "Money", count = 5000},

    HighlightNearLoots = true,
    CollectableLoots = {
        {item = "whiskey", label = "Whisky", object = "prop_bottle_richard", coords = vector3(-2083.281, -1013.483, 5.755), heading = 0.0, chancetospawn = 50}, -- the chance is in percentages
        {item = "laptop", label = "Laptop", object = "prop_laptop_02_closed", coords = vector3(-2089.171, -1012.758, 5.782), heading = 0.0, chancetospawn = 60},
        {item = "laptop", label = "Laptop", object = "prop_laptop_02_closed", coords = vector3(-2058.118, -1024.084, 12.001), heading = 0.0, chancetospawn = 70},
        {item = "gold_award", label = "Gold Award", object = "ex_prop_exec_award_gold", coords = vector3(-2096.027, -1007.098, 5.750), heading = 0.0, chancetospawn = 50},
        {item = "drug_pack", label = "Drug Pack", object = "hei_prop_hei_drug_pack_02", coords = vector3(-2093.656, -1015.328, 9.074), heading = 80.0, chancetospawn = 90},
        {item = "drug_pack", label = "Drug Pack", object = "ex_office_swag_drugbags", coords = vector3(-2078.893, -1021.743, 5.850), heading = 180.0, chancetospawn = 90},
        {item = "drug_pack", label = "Drug Pack", object = "hei_prop_hei_drug_pack_01a", coords = vector3(-2083.006, -1019.682, 12.739), heading = -17.0, chancetospawn = 100},
    },

    HighlightNearArts = true,
    ArtSteal = {
        {item = "painting", label = "Painting", object = 'ch_prop_vault_painting_01e', coords = vector3(-2085.606, -1021.154, 5.973), heading = 162.0, chancetospawn = 100},
        {item = "painting", label = "Painting", object = 'ch_prop_vault_painting_01h', coords = vector3(-2090.608, -1009.536, 5.926), heading = -107.36, chancetospawn = 100},
    },

    Guards = {
        {
			coords = vector3(-2037.0341, -1027.6553, 5.8820), -- NPC spawn coords
			pedModel = "s_m_m_highsec_01", -- NPC model
			weapon = "WEAPON_ASSAULTRIFLE", -- Weapon
		},
		{
			coords = vector3(-2042.3258, -1038.4536, 5.8827), -- NPC spawn coords
			pedModel = "s_m_m_highsec_01", -- NPC model
			weapon = "WEAPON_ASSAULTRIFLE", -- Weapon
		},
		{
			coords = vector3(-2081.3970, -1025.9827, 5.8828), -- NPC spawn coords
			pedModel = "s_m_m_highsec_01", -- NPC model
			weapon = "WEAPON_ASSAULTRIFLE", -- Weapon
		},
		{
			coords = vector3(-2074.9980, -1018.6064, 5.8841), -- NPC spawn coords
			pedModel = "s_m_m_highsec_01", -- NPC model
			weapon = "WEAPON_ASSAULTRIFLE", -- Weapon
		},
		{
			coords = vector3(-2074.3450, -1014.7513, 5.8820), -- NPC spawn coords
			pedModel = "s_m_m_highsec_01", -- NPC model
			weapon = "WEAPON_ASSAULTRIFLE", -- Weapon
		},
    },

    Lockboxes = {
		{
			coords = vector3(-2067.530, -1018.543, 4.878),
            heading = -18.0
		},
		{
			coords = vector3(-2066.751, -1019.933, 4.878),
            heading = -107.0
		},
		{
			coords = vector3(-2067.333, -1021.842, 4.878),
            heading = -107.0
		},
		{
			coords = vector3(-2068.845, -1022.527, 4.878),
            heading = 162.0
		},
	},

	Trolleys = {
		{
			model = "hei_prop_hei_cash_trolly_01",
			coords = vector3(-2068.983, -1020.724, 4.8820),
			heading = 160.0,
		},
	},

    Animations = {
		["keypadHacking"] = "anim_heist@hs3f@ig1_hack_keypad@arcade@male@",
	},

	Props = {
		["door"] = "ch_prop_ch_vault_d_door_01a",
		["usb"] = "ch_prop_ch_usb_drive01x",
		["phone"] = "prop_phone_ing",
		["keypad"] = "prop_ld_keypad_01b",
		["tablet"] = "prop_cs_tablet",
	},
    
-----------------------------------------------------------
-----------------------| TRANSLATE |-----------------------
-----------------------------------------------------------

    MoneyForm = '$',

    HelpNotify = {
        [1] = {'Press ~INPUT_PICKUP~ to cut right', 38},
        [2] = {'Press ~INPUT_PICKUP~ to cut down', 38},
        [3] = {'Press ~INPUT_PICKUP~ to cut left', 38},
    },

    Texts = {
        [1] = {'[E] - To start the yacht heist', 38},
        [2] = {'[E] - To start hacking the safe', 38},
        [3] = {'[E] - To start drilling the locker', 38},
        [4] = {'[E] - To grab the money', 38},
        [5] = {'[E] - To steal the loot', 38},
        [6] = {'[E] - To steal the painting', 38},
        [7] = {'[E] - To sell the items', 38},
    },

    Notify = {
        [1] =  {'Notification', "There is already a heist in progress.", 5000, 'error'},
        [2] =  {'Notification', "Not enough cops in the City!", 5000, 'error'},
        [3] =  {'Notification', "The heist has started!", 5000, 'success'},
        [4] =  {'Notification', "The hacking has failed!", 5000, 'error'},
        [5] =  {'Notification', "The heist has finished!", 5000, 'success'},
        [6] =  {'Notification', "You successfully hacked the safe!", 5000, 'success'},
        [7] =  {'Notification', "You don't have the right item to do it!", 5000, 'error'},
        [8] =  {'Notification', "You sold:", 5000, 'success'},
        [9] =  {'Notification', "You got:", 5000, 'success'},
        [10] =  {'Notification', "You dont't have anything to sell!", 5000, 'error'},
        [11] =  {'Notification', "Sell the items in the designated place!", 10000, 'info'},
        [12] =  {'Notification', "Time's up! The Boss has left!", 5000, 'error'},
        [13] =  {'Notification', "Yacth Heist is in progress. Marked on the map!", 5000, 'info'},
        [14] =  {'Notification', "You are too far away to start the heist!", 5000, 'error'},
        [15] =  {'Notification', "There was a heist a while ago, you have to wait!", 5000, 'error'},
        [16] =  {'Notification', "The yacht heist has ended!", 5000, 'info'},
    },

    IdentifierType = 'steam',  -- steam / license / discord
    Webhooks = {
        Locale = {
            ['heistProcess'] = '⌛ Heist started...',
            ['heistFinished'] = '✅ Heist finished.',

            ['HasStarted'] = 'started the Yacht Heist!',
            ['HasFinished'] = 'finished the Yacht Heist!',
            ['RobberHasQuit'] = '**The robber has quit the game!\nThe heist has finished!**',

            ['Identifier'] = 'Identifier',

            ['Time'] = 'Time ⏲️'
        },

        -- To change a webhook color you need to set the decimal value of a color, you can use this website to do that - https://www.mathsisfun.com/hexadecimal-decimal-colors.html
        Colors = {
            ['heistProcess'] = 3145631, 
            ['heistFinished'] = 16711680
        }
    },
}
client-utils.lua
ESX = Core
QBCore = Core

-- 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
        TriggerEvent('brutal_yacht_heist:client:DefaultNotify', text)
    end
end

RegisterNetEvent('brutal_yacht_heist:client:DefaultNotify')
AddEventHandler('brutal_yacht_heist:client:DefaultNotify', function(text)
    
    SetNotificationTextEntry("STRING")
    AddTextComponentString(text)
    DrawNotification(0,1)

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

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

RegisterNetEvent('brutal_yacht_heist:client:PoliceAlert')
AddEventHandler('brutal_yacht_heist:client:PoliceAlert', function(coords)
    notification(Config.Notify[13][1], Config.Notify[13][2], Config.Notify[13][3], Config.Notify[13][4])

    AlertPlace = AddBlipForCoord(coords[1], coords[2], coords[3])
    SetBlipSprite(AlertPlace, Config.Blips.PoliceAlertBlip.sprite)
    SetBlipScale(AlertPlace, Config.Blips.PoliceAlertBlip.size)
    SetBlipColour(AlertPlace, Config.Blips.PoliceAlertBlip.color)
    BeginTextCommandSetBlipName('STRING')
    AddTextComponentSubstringPlayerName(Config.Blips.PoliceAlertBlip.label)
    EndTextCommandSetBlipName(AlertPlace)
end)

RegisterNetEvent('brutal_yacht_heist:PlayerInHeistAnim')
AddEventHandler('brutal_yacht_heist:PlayerInHeistAnim', function()
    -- this event run when the player start an anim in the heist.

    --exports['qs-smartphone']:canUsePhone(false)
    --exports["lb-phone"]:ToggleDisabled(true)
end)

RegisterNetEvent('brutal_yacht_heist:PlayerOutOfHeistAnim')
AddEventHandler('brutal_yacht_heist:PlayerOutOfHeistAnim', function()
    -- this event run when the player finishes an anim in the heist.

    --exports['qs-smartphone']:canUsePhone(true)
    --exports["lb-phone"]:ToggleDisabled(false)
end)

function TextUIFunction(type, text)
    if type == 'open' then
        if Config.TextUI:lower() == 'ox_lib' then
            lib.showTextUI(text)
        elseif Config.TextUI:lower() == 'okoktextui' then
            exports['okokTextUI']:Open(text, 'darkblue', 'right')
        elseif Config.TextUI:lower() == 'esxtextui' then
            ESX.TextUI(text)
        elseif Config.TextUI:lower() == 'qbdrawtext' then
            exports['qb-core']:DrawText(text,'left')
        end
    elseif type == 'hide' then
        if Config.TextUI:lower() == 'ox_lib' then
            lib.hideTextUI()
        elseif Config.TextUI:lower() == 'okoktextui' then
            exports['okokTextUI']:Close()
        elseif Config.TextUI:lower() == 'esxtextui' then
            ESX.HideUI()
        elseif Config.TextUI:lower() == 'qbdrawtext' then
            exports['qb-core']:HideText()
        end
    end
end

function PlayerDied()
    local died = false
    if (GetEntityHealth(PlayerPedId()) <= PlayerDiedHealth) then
        died = true
    end
    return died
end

function NoCarryWeapon()
    if GetSelectedPedWeapon(PlayerPedId()) == GetHashKey('WEAPON_UNARMED') then
        return true
    else
        SendNotify(18)
        return false
    end
end
server-utils.lua
local YourWebhook = 'WEBHOOK-HERE'  -- help: https://docs.brutalscripts.com/site/others/discord-webhook

function GetWebhook()
    return YourWebhook
end

-- Buy here: (4€+VAT) https://store.brutalscripts.com
function notification(source, title, text, time, type)
    if Config.BrutalNotify then
        TriggerClientEvent('brutal_notify:SendAlert', source, title, text, time, type)
    else
        TriggerClientEvent('brutal_yacht_heist:client:DefaultNotify', text)
    end
end

function PlayerNameFunction(source)
    return GetPlayerName(source)
end

RegisterServerEvent('brutal_yacht_heist:server:PoliceAlert')
AddEventHandler('brutal_yacht_heist:server:PoliceAlert', function(coords)
    local Players = GetPlayersFunction()
	for i = 1, #Players do
        for ii=1, #Config.CopsJobs do
            if GetPlayerJobFunction(Players[i]) == Config.CopsJobs[ii] then
                TriggerClientEvent('brutal_yacht_heist:client:PoliceAlert', Players[i], coords)
             end
         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
    
    LoadedEvent = 'esx:playerLoaded'
    TSCB = Core.TriggerServerCallback
    PlayerDiedHealth = 0

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

    Core = exports['qb-core']:GetCoreObject()
    TSCB = Core.Functions.TriggerCallback
    PlayerDiedHealth = 100
    LoadedEvent = 'QBCore:Client:OnPlayerLoaded'
    
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.addMoney(amount)
    end

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

    function GetItemCount(source, item)
        local xPlayer = GETPFI(source)

        if _esx_ == 'new' then
            return xPlayer.getInventoryItem(item).count
        else
            if string.sub(item, 0, 6):lower() == 'weapon' then
                local loadoutNum, weapon = xPlayer.getWeapon(item:upper())

                if weapon then
                    return true
                else
                    return false
                end
            else
                return xPlayer.getInventoryItem(item).count
            end
        end
    end

    function AddItem(source, item, count)
        local xPlayer = GETPFI(source)
        if _esx_ == 'new' then
            xPlayer.addInventoryItem(item, count)
        else
            if string.sub(item, 0, 6):lower() == 'weapon' then
                xPlayer.addWeapon(item, 90)
            else
                xPlayer.addInventoryItem(item, count)
            end
        end
    end

    function RemoveItem(source, item, amount)
        local xPlayer = GETPFI(source)
        if _esx_ == 'new' then
            xPlayer.removeInventoryItem(item, amount)
        else
            if string.sub(item, 0, 6):lower() == 'weapon' then
                xPlayer.removeWeapon(item)
            else
                xPlayer.removeInventoryItem(item, amount)
            end
        end
    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 GetItemCount(source, item)
        local xPlayer = GETPFI(source)

        local items = xPlayer.Functions.GetItemByName(item)
        local item_count = 0
        if items ~= nil then
            item_count = items.amount
        else
            item_count = 0
        end
        return item_count
    end

    function AddItem(source, item, count)
        local xPlayer = GETPFI(source)
        xPlayer.Functions.AddItem(item, count)
    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