⚙️Configuration

Here's a preview of all the config files of the script

config.lua
Config = {}

--- [[ Markhor Bridge ]] ---
--- [[ Markhor Bridge ]] ---


--- This resource depends on Markhor Bridge.
--- With Markhor Bridge, all necessary settings (such as framework, inventory, interact, etc.) are automatically set.
--- You don't have to do anything except install Markhor Bridge.


--- [[ Markhor Bridge ]] ---
--- [[ Markhor Bridge ]] ---

Config.showInteractMessage = false -- This sends a message to the person standing at an ATM to be robbed.
Config.hideItemInteract = true -- As soon as someone does not have a correct item, the target option will be hidden.
Config.drawMissionText = true -- As soon as the text at the bottom of the screen is not displayed, set it to false. (recommended: true)
Config.targetDistance = 2.0 -- Change the distance from where target is triggered at the ATM. Default: 2.0
Config.scaleText = 0.5 -- Use this option once "Config.drawMissionText" is set to false. This allows you to scale the text.
Config.xText = 0.5 -- Use this option once "Config.drawMissionText" is set to false. This allows you to move the text in width.
Config.yText = 0.95 -- Use this option once "Config.drawMissionText" is set to false. This allows you to move the text in height.
Config.bombProp = "prop_bomb_01_s"
Config.cashProp = "hei_prop_cash_crate_half_full"

Config.language = "EN" -- Choose Language -> "EN" / "NL".
Config.changeBag = true -- Adds a bag when picking up money. Disable this if it doesn't work with scripts in your server
Config.skinEvent = 'skinchanger:getSkin' -- Change this event to your own event name.
Config.skinLoadEvent = 'skinchanger:loadClothes' -- Event to update the clothes.

Config.pickupMoneyKey = 47 -- This key is used to pick up the money after a successful robbery. -> Default G
Config.minCops = 0 -- The minimum number of cops (Config.copJobs) that must be online.
Config.robberyItem = 'tool' -- The item needed to start a robbery.
Config.maxATMDist = 5.0 -- The player must be within this distance of the ATM before the heist is initiated.
Config.maxRange = 30.0 -- After this distance, the robbery is cancelled.
Config.distWarning = 12.0 -- Within this distance, it waits until the player is far enough away. 
Config.killDist = 3.5 -- Within this distance, players die when the ATM explodes.
Config.moneyTimer = 180 -- Time in seconds the player gets from the explosion to pick up the loot.
Config.robberyCooldown = 180 -- Time in seconds between the robberies.

-- [[ CHANCES ]] --
-- Below are the chances of what can happen during a robbery. A random number between 0 and 100 is taken to determine a chance whether the robbery will go well.
Config.successfullChance = 25 -- %

-- As soon as this value exceeds Config.successfullChance, something goes wrong and a random number between 0 and 100 is chosen again.
-- This number determines what will happen to the robbery and works as follows:
-->> Number between 0 and Config.failChance: the explosive will not go off. The action ends without any prosecution, no alarm is sounded.
Config.failChance = 20 -- The probability that it will activate = Config.failChance - 0 -> default 20-0=20%

-->> Number between Config.failChance and Config.alarmChance:
--   an alarm will sound immediately when the explosive is placed. The police will be informed but the robbery will be successful.
Config.alarmChance = 40 -- The probability that it will activate = Config.alarmChance - Config.failChance -> default 40-20=20%

-->> Number between Config.alarmChance and Config.explosionAlarmChance: the explosion will trigger an alarm, so the players
--   have more time to escape as the police will be notified later.
Config.explosionAlarmChance = 70 -- The probability that it will activate = Config.explosionAlarmChance - Config.alarmChance -> default 70-40=30%

-->> Number between Config.explosionAlarmChance and Config.trackerChance: the explosion will trigger an alarm.
--   While picking up the loot, the player and the police receive a message about a tracker,
--   this tracker remains on the player who started the robbery during Config.trackerTime.
Config.trackerChance = 100 -- The probability that it will activate = Config.trackerChance - Config.explosionAlarmChance -> default 100-70=30%
Config.trackerTime = 180   -- Seconds
Config.refreshRate = 1000  -- Milliseconds. The refresh time for the tracker, the lower the smoother the tracker moves but the more performance it costs.
-- [[ END OF CHANCES ]] --

-- How long a robbery takes from the moment of placement is determined by a random time between Config.minTimer and Config.maxTimer.
Config.minTimer = 50 -- The time in seconds how long a robbery must last.
Config.maxTimer = 90 -- The time in seconds for how long a robbery may last.

-- All ATMs named in Config.robATMs can be used for a robbery.
Config.robATMs = {
    [`prop_fleeca_atm`] = true,
    [`prop_atm_01`] = true,
    [`prop_atm_02`] = true,
}

-- The jobs in Config.copJobs will be notified when the alarm of an ATM robbery has been triggered.
Config.copJobs = {
    'police',
    'army'
}

-- The jobs in Config.blacklistJobs cannot start an ATM robbery.
Config.blacklistJobs = {
    'ambulance',
    'police',
    'army'
}

-- In Config.blips the blip settings can be adjusted for the alarm and for the tracker.
Config.blips = {
    alarm = {
        sprite = 161,
        scale = 2.0,
        color = 3
    },
    tracker = {
        sprite = 1,
        scale = 1.0,
        color = 1
    }
}

-- In Config.rewards the reward for an ATM robbery can be set. Only money and items are possible, weapons are not.
-- The number/amount that the player gets is a random number between min and max.
-- The valueItem parameter specifies whether the item should have a specific value. You then get one item with a random number between min and max as value. [QBCORE only]
Config.rewards = {
    { type = 'item', label = 'Black Money', item = 'markedbills', valueItem = true, min = 50000, max = 60000 },
    { type = 'money', label = 'Bank', item = 'bank', valueItem = false, min = 5000, max = 6000 },
}

-- Once the loot has been picked up, the player receives a bag. This bag is the number of Config.replaceBag.
-- If a player already has a bag with a matching number in Config.maleBags or Config.womanBags,
-- this option will be skipped and the player will keep the bag that the player already has.
Config.maleBags = { 40, 41, 44, 45, 81, 82, 85, 86, 102, 103, 109, 112, 113, 114 }
Config.womanBags = { 40, 41, 44, 45, 81, 82, 85, 86, 104, 107, 108, 109, 110 }
Config.replaceBag = 45 -- The default bag a player receives when the player does not have a bag from Config.maleBags or Config.womanBags.

-- With this function it is possible to add a custom way to the police alert. The function is called server side.
Config.policeAlert = function(position, tracker, entity, src)
    local blip_info = {
        sprite = Config.blips.alarm.sprite,
        scale = Config.blips.alarm.scale,
        colour = Config.blips.alarm.color,
        flashes = false,
        text = Language[Config.language].blipName,
        time = Config.trackerTime,
        radius = 0,
    }

    local txt = Language[Config.language].alarm
    if tracker then txt = Language[Config.language].alarmTracker end
    exports["markhor_bridge"]:sendPoliceAlert(src, position, Language[Config.language].blipName, txt, blip_info, Config.copJobs)

    if tracker then
        local t0, t1, count = GetGameTimer(), GetGameTimer() + Config.trackerTime * 1000, 1
        while t0 < t1 do
            Citizen.Wait(Config.refreshRate)
            local coords = GetEntityCoords(NetworkGetEntityFromNetworkId(entity))
            TriggerClientEvent('mh_thud:sendTracker', -1, coords, false, count)
            count = count + 1
            t0 = GetGameTimer()
        end
        TriggerClientEvent('mh_thud:sendTracker', -1, nil, true, 0)
    end
end

-- With this function it is possible to add notifications in the way you want! The function is called client side.
Config.showNotification = function(message, type)
    exports["markhor_bridge"]:sendNotification(message, type)
end

-- With this function it is possible to add missiontext in the way you want! The function is called client side.
Config.drawMissionText = function(msg, time)
	if Config.drawMissionText then
		ClearPrints()
		SetTextEntry_2('STRING')
		AddTextComponentString(msg)
		DrawSubtitleTimed(time, 1)
	else		
		SetTextFont(8)
		SetTextProportional(0)
		SetTextScale(Config.scaleText, Config.scaleText)
		SetTextDropShadow(0, 0, 0, 0,255)
		SetTextEdge(2, 0, 0, 0, 255)
		SetTextDropShadow()
		SetTextOutline()
		SetTextCentre(true)
		SetTextEntry("STRING")
		AddTextComponentString(text)
		DrawText(Config.xText, Config.yText)
	end
end
language.lua
Language = {
	["EN"] = {
		["targetLabel"] = "Start robbery",
		["targetLoot"] = "Get loot",
		["robberyStarted"] = "~y~Positioning explosive. ~b~Cancel with /cancelrobbery",
		["alreadyBusy"] = "There's already an ATM robbery going on!",
		["noCops"] = "There are ~r~insufficient ~y~ authorities employed",
		["noATM"] = "~r~None ~g~Fleeca ~y~ATM ~w~nearby",
		["cancelRobbery"] = "Robbery ~r~cancelled",
		["cooldownEnabled"] = "There has just been an ATM robbery. Please wait %s more seconds",
		
		["canRobATM"] = "~y~You can rob this ATM",
		["itemPlaced"] = "~y~Explosively posted. Take your distance",
		["itemBurn"] = "~y~Explosive Detonates",
		["itemFailed"] = "~y~The explosive ~r~is not detonating!",

		["robberyRange"] = "Don't ~r~run too far ~w~before you ~b~pick it up~w~!",
		["rangeFail"] = "You are ~r~far away ~w~from the ATM. The ~b~money ~w~has been ~r~removed~w~!",
		["timesUp"] = "The ~r~time is over~w~. The ~b~money ~w~has been ~r~deleted~w~!",
		["reward"] = "The ATM robbery is successful! You received ~g~%s %s ~w~ as a reward!",
		["currencyIcon"] = "$",
		["getMoney"] = "~y~Pick up the ~g~money in ~b~%s:%s minutes ~y~",
		["getMoney2"] = "~y~Pick up the ~g~money within ~b~%s:%s minutes ~y~with [G]",
		["alarm"] = "An explosion ~y~alarm~w~ has gone off!",
		["alarmTracker"] = "An explosion ~y~alarm~w~ has gone off! A ~b~tracker has been ~g~activated~w~ for 180 seconds!",
		["tracker"] = "There's a ~r~tracker in the money! ~y~Run!",

		["blacklistJobs"] = "You are a ~b~cop~w~.~n~You can't start a robbery!",
		["blipName"] = "ATM robbery",
		["cmdDesc"] = "Cancel the robbery",
		["noItem"] = "You need a %s to start the robbery!",

		-- LOGS
		["logStart"] = "initiated a robbery",
		["logCancel"] = "canceled a raid",
		["logAlarm"] = "triggered the alarm",
		["logReward"] = "received %s %s",
	},

	["NL"] = {
		["targetLabel"] = "Start overval",
		["targetLoot"] = "Get loot",
		["robberyStarted"] = "~y~Pizzaschuiver wordt geplaatst. ~b~Annuleer met /cancelrobbery",
		["alreadyBusy"] = "Er is al een plofkraak aan de gang!",
		["noCops"] = "Er zijn ~r~onvoldoende autoriteiten ~y~in dienst",
		["noATM"] = "~r~Geen ~g~Fleeca ~y~pinautomaat ~w~in de buurt",
		["cancelRobbery"] = "Plofkraak ~r~geannuleerd",
		["cooldownEnabled"] = "Er is zojuist een plofkraak geweest. Wacht nog %s seconden",

		["canRobATM"] = "~y~You can rob this ATM",
		["itemPlaced"] = "~y~Pizzaschuiver geplaatst. Neem afstand",
		["itemBurn"] = "~y~Pizzaschuiver ontsteekt",
		["itemFailed"] = "~y~De pizzaschuiver ~r~gaat niet af!",

		["robberyRange"] = "Zorg dat je ~r~niet ver weg ~w~rent voordat je het ~b~opraapt~w~!",
		["rangeFail"] = "Je bent te ~r~ver weg ~w~van de plofkraak. Het ~b~geld ~w~is ~r~verwijderd~w~!",
		["timesUp"] = "De ~r~tijd is voorbij~w~. Het ~b~geld ~w~is ~r~verwijderd~w~!",
		["reward"] = "De plofkraak is succesvol! Je hebt ~g~%s %s ~w~ontvangen als beloning!",
		["currencyIcon"] = "$",
		["getMoney"] = "~y~Raap het ~g~geld binnen ~b~%s:%s min ~y~op",
		["getMoney2"] = "~y~Raap het ~g~geld binnen ~b~%s:%s min ~y~op met [G]",
		["alarm"] = "Er is een plofkraak ~y~alarm~w~ afgegaan!",
		["alarmTracker"] = "Er is een plofkraak ~y~alarm~w~ afgegaan! Er is een ~b~tracker ~g~geactiveerd~w~ voor 180 seconde!",
		["tracker"] = "Er zit een ~r~tracker in het geld! ~y~Vlucht!",

		["blacklistJobs"] = "Je bent een ~b~agent~w~.~n~Je kan geen plofkraak starten!",
		["blipName"] = "Plofkraak",
		["cmdDesc"] = "Annuleer de profkraak",
		["noItem"] = "Je hebt een %s nodig om de plofkraak te starten!",

		-- LOGS
		["logStart"] = "heeft een overval gestart",
		["logCancel"] = "heeft een overval geannuleerd",
		["logAlarm"] = "heeft het alarm laten afgaan",
		["logReward"] = "heeft %s %s ontvangen",
	}
}

Last updated