đConfigurables
In this page, you can see everything that can be configured/changed within this script.
All of the code from frameworks, inventories & such are not displayed in here. This code is triggered within the fmLib dependency script. All of the dependencies code are also opensourced within fmLib.
Config
This is the config.lua from one of the map variants, to give you some more insight in what is changeable in the config of the scripts. All variants their config.lua file has the same structure.
--[[
BY CrimeM Š crimem.com
--]]
Config = {}
Config.ImgDirectory = 'ox_inventory/web/images/'
Config.Locale = 'en'
Config.Cooldown = 60 * 60 * 1 -- Cooldown in seconds
Config.AlwaysLocked = false -- If true, the doors will be locked all the time, otherwise only when the robbery started
Config.ThermiteTime = 5000 -- Time in ms to burn the door after all animations are done
Config.C4Time = 5000 -- Time in ms to detonate the C4 after placement animations are done
Config.MinimumCops = { -- Minimum amount of cops required to start the robbery
jobs = { 'police', },
amount = 1,
}
Config.Start = {
door = {
model = 517314340,
coords = vector3(-448.179108, -76.391006, 41.447380),
},
requiredItems = { -- Required items to start the robbery, when remove = true, the item(s) will be removed when the robbery starts
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
{ item = 'WEAPON_SWITCHBLADE', label = 'Switchblade', amount = 1, remove = false },
{ item = 'drill', label = 'Drill', amount = 1, remove = false },
{ item = 'c4_bomb', label = 'C4 Bomb', amount = 2, remove = false },
{ item = 'thermite_bomb', label = 'Thermite Bomb', amount = 2, remove = false },
{ item = 'usb_stick', label = 'USB Stick', amount = 1, remove = false },
{ item = 'glass_cutter', label = 'Glass Cutter', amount = 1, remove = false },
{ item = 'safe_cracker', label = 'Safe Cracker', amount = 1, remove = false },
},
}
Config.Robbery = {
-- Loot under here is started when the robbery is started, we recommend putting the loot in the doors below, to prevent hackers to exploit.
-- Unless there is no specific door for the loot, the loot will be set in here
startLoot = {
smashes = {
{
coords = vector3(-454.058, -77.303, 41.525),
model = 'des_jewel_cab_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'golden_ring', label = 'Golden Ring', min = 1, max = 4 },
{ item = 'silver_ring', label = 'Silver Ring', min = 1, max = 4 },
{ item = 'diamond_ring', label = 'Diamond Ring', min = 1, max = 2 },
}
},
scene = {
coords = vector3(-453.5794, -77.0050, 40.2876),
rotation = vector3(0.0, 0.0, 129.0),
}
},
{
coords = vector3(-455.346, -75.802, 41.525),
model = 'des_jewel_cab_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'silver_watch', label = 'Silver Watch', min = 1, max = 4 },
{ item = 'diamond_watch', label = 'Diamond Watch', min = 1, max = 2 },
}
},
scene = {
coords = vector3(-454.8415, -75.2564, 40.2857),
rotation = vector3(0.0, 0.0, 129.0),
}
},
{
coords = vector3(-456.551, -74.267, 41.525),
model = 'des_jewel_cab3_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'silver_ring', label = 'Silver Ring', min = 1, max = 4 },
{ item = 'silver_watch', label = 'Silver Watch', min = 1, max = 4 },
}
},
scene = {
coords = vector3(-455.8725, -73.7794, 40.2857),
rotation = vector3(0.0, 0.0, 129.0),
}
},
{
coords = vector3(-457.735, -72.778, 41.525),
model = 'des_jewel_cab4_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'diamond_ring', label = 'Diamond Ring', min = 1, max = 2 },
{ item = 'diamond_watch', label = 'Diamond Watch', min = 1, max = 2 },
}
},
scene = {
coords = vector3(-457.2686, -72.3555, 40.2857),
rotation = vector3(0.0, 0.0, 129.0),
}
},
{
coords = vector3(-459.092, -71.306, 41.525),
model = 'des_jewel_cab2_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'golden_ring', label = 'Golden Ring', min = 1, max = 4 },
{ item = 'silver_ring', label = 'Silver Ring', min = 1, max = 4 },
}
},
scene = {
coords = vector3(-458.5413, -70.6662, 40.2870),
rotation = vector3(0.0, 0.0, 129.0),
}
},
{
coords = vector3(-460.338, -69.86, 41.525),
model = 'des_jewel_cab3_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'golden_ring', label = 'Golden Ring', min = 1, max = 4 },
{ item = 'silver_ring', label = 'Silver Ring', min = 1, max = 4 },
}
},
scene = {
coords = vector3(-459.6806, -69.1924, 40.2883),
rotation = vector3(0.0, 0.0, 129.0),
}
},
{
coords = vector3(-451.843, -72.653, 41.525),
model = 'des_jewel_cab3_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'silver_watch', label = 'Silver Watch', min = 1, max = 4 },
{ item = 'diamond_watch', label = 'Diamond Watch', min = 1, max = 2 },
}
},
scene = {
coords = vector3(-451.4920, -73.2975, 40.2852),
rotation = vector3(0.0, 0.0, 36.0),
}
},
{
coords = vector3(-453.035, -73.604, 41.525),
model = 'des_jewel_cab4_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'silver_ring', label = 'Silver Ring', min = 1, max = 4 },
{ item = 'silver_watch', label = 'Silver Watch', min = 1, max = 4 },
}
},
scene = {
coords = vector3(-452.3849, -74.2573, 40.2854),
rotation = vector3(0.0, 0.0, 36.0),
}
},
{
coords = vector3(-454.592, -72.864, 41.524),
model = 'des_jewel_cab2_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'diamond_ring', label = 'Diamond Ring', min = 1, max = 2 },
{ item = 'diamond_watch', label = 'Diamond Watch', min = 1, max = 2 },
}
},
scene = {
coords = vector3(-455.3254, -73.2794, 40.2854),
rotation = vector3(0.0, 0.0, -54.0),
}
},
{
coords = vector3(-455.258, -71.072, 41.525),
model = 'des_jewel_cab4_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'golden_ring', label = 'Golden Ring', min = 1, max = 4 },
{ item = 'silver_ring', label = 'Silver Ring', min = 1, max = 4 },
}
},
scene = {
coords = vector3(-455.6608, -70.3560, 40.2854),
rotation = vector3(0.0, 0.0, -142.0),
}
},
{
coords = vector3(-454.026, -70.134, 41.525),
model = 'des_jewel_cab3_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'golden_ring', label = 'Golden Ring', min = 1, max = 4 },
{ item = 'silver_ring', label = 'Silver Ring', min = 1, max = 4 },
}
},
scene = {
coords = vector3(-454.4854, -69.5925, 40.2853),
rotation = vector3(0.0, 0.0, -142.0),
}
},
{
coords = vector3(-447.85, -72.426, 41.525),
model = 'des_jewel_cab_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'golden_ring', label = 'Golden Ring', min = 1, max = 4 },
{ item = 'silver_ring', label = 'Silver Ring', min = 1, max = 4 },
}
},
scene = {
coords = vector3(-448.6842, -72.8301, 40.2874),
rotation = vector3(0.0, 0.0, -51.0),
}
},
{
coords = vector3(-449.078, -70.788, 41.525),
model = 'des_jewel_cab_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'golden_ring', label = 'Golden Ring', min = 1, max = 4 },
{ item = 'silver_ring', label = 'Silver Ring', min = 1, max = 4 },
{ item = 'diamond_ring', label = 'Diamond Ring', min = 1, max = 2 },
}
},
scene = {
coords = vector3(-449.8807, -71.2636, 40.2857),
rotation = vector3(0.0, 0.0, -51.0),
}
},
{
coords = vector3(-450.427, -69.216, 41.525),
model = 'des_jewel_cab4_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'silver_watch', label = 'Silver Watch', min = 1, max = 4 },
{ item = 'diamond_watch', label = 'Diamond Watch', min = 1, max = 2 },
}
},
scene = {
coords = vector3(-451.0854, -69.6289, 40.2857),
rotation = vector3(0.0, 0.0, -51.0),
}
},
{
coords = vector3(-451.592, -67.789, 41.525),
model = 'des_jewel_cab_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'golden_ring', label = 'Golden Ring', min = 1, max = 4 },
}
},
scene = {
coords = vector3(-452.1780, -68.1648, 40.2857),
rotation = vector3(0, 0, -51.0),
}
},
{
coords = vector3(-452.843, -66.279, 41.525),
model = 'des_jewel_cab3_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'golden_ring', label = 'Golden Ring', min = 1, max = 4 },
{ item = 'diamond_ring', label = 'Diamond Ring', min = 1, max = 2 },
{ item = 'diamond_watch', label = 'Diamond Watch', min = 1, max = 2 },
}
},
scene = {
coords = vector3(-453.5005, -66.7254, 40.2868),
rotation = vector3(0, 0, -51.0),
}
},
{
coords = vector3(-454.028, -64.804, 41.525),
model = 'des_jewel_cab_start',
requiredItems = {
{ item = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'golden_ring', label = 'Golden Ring', min = 1, max = 4 },
{ item = 'diamond_ring', label = 'Diamond Ring', min = 1, max = 2 },
{ item = 'silver_watch', label = 'Silver Watch', min = 1, max = 4 },
}
},
scene = {
coords = vector3(-454.6251, -65.2441, 40.2881),
rotation = vector3(0, 0, -51.0),
}
},
},
paintings = {
{
model = 'h4_prop_h4_painting_01e',
coords = vector3(-454.551, -61.312, 41.319),
heading = 40.0,
requiredItems = {
{ item = 'WEAPON_SWITCHBLADE', label = 'Switchblade', amount = 1, remove = false },
},
rewards = {
items = {
{ item = 'van_gogh', label = 'Van Gogh', min = 1, max = 1 },
}
},
scene = { -- Scene settings are required for stealing paintings
coords = vector3(-454.1523, -61.5138, 41.2888)
}
},
},
lockers = {
{
coords = vector3(-458.369, -67.791, 41.017),
rotation = vector3(0.0, 0.0, -140.0),
requiredItems = {
{ item = 'drill', label = 'Drill', amount = 1, remove = false },
},
rewards = {
money = { type = 'bank', min = 2500, max = 10000 },
items = {
-- { item = 'silver_watch', label = 'Silver Watch', min = 1, max = 4 },
-- { item = 'diamond_watch', label = 'Diamond Watch', min = 1, max = 2 },
}
}
},
{
coords = vector3(-447.804, -60.263, 41.339),
rotation = vector3(0.0, 0.0, -140.0),
requiredItems = {
{ item = 'drill', label = 'Drill', amount = 1, remove = false },
},
rewards = {
money = { type = 'bank', min = 2500, max = 10000 },
items = {
-- { item = 'silver_watch', label = 'Silver Watch', min = 1, max = 4 },
-- { item = 'diamond_watch', label = 'Diamond Watch', min = 1, max = 2 },
}
}
},
{
coords = vector3(-453.099, -58.559, 41.468),
rotation = vector3(0.0, 0.0, 35.0),
requiredItems = {
{ item = 'drill', label = 'Drill', amount = 1, remove = false },
},
rewards = {
money = { type = 'bank', min = 2500, max = 10000 },
items = {
-- { item = 'silver_watch', label = 'Silver Watch', min = 1, max = 4 },
-- { item = 'diamond_watch', label = 'Diamond Watch', min = 1, max = 2 },
}
}
},
},
},
-- Loot is mostly setupped within the doors below, so it spawns when a door has been opened, in order to prevent hackers from exploiting.
doors = {
entranceLeft = {
action = 'c4',
requiredItems = {
{ item = 'c4_bomb', label = 'C4 Bomb', amount = 1, remove = true },
},
scene = { -- Scene settings are required for c4
coords = vector3(-449.3423, -77.4334, 41.2930),
rotation = vector3(0.0, 0.0, 38.0),
}
},
entranceRight = {
action = 'c4',
requiredItems = {
{ item = 'c4_bomb', label = 'C4 Bomb', amount = 1, remove = true },
},
scene = { -- Scene settings are required for c4
coords = vector3(-448.9161, -77.0545, 41.2932),
rotation = vector3(0.0, 0.0, 38.0),
}
},
insideLeft = {
action = 'thermite',
requiredItems = {
{ item = 'thermite_bomb', label = 'Thermite Bomb', amount = 1, remove = true },
},
scene = { -- Scene settings are required for thermite
coords = vector3(-453.3632, -61.3795, 41.2960),
rotation = vector3(0.0, 0.0, -20.0),
}
},
insideRight = {
action = 'thermite',
requiredItems = {
{ item = 'thermite_bomb', label = 'Thermite Bomb', amount = 1, remove = true },
},
scene = { -- Scene settings are required for thermite
coords = vector3(-448.7033, -67.0725, 41.2959),
rotation = vector3(0.0, 0.0, -49.0),
},
displays = {
{
glassCoords = vector3(-444.6100, -62.6092, 40.2904), -- Coords for the glass
glassHeading = 310.0, -- Heading for the glass
valuables = { -- It takes a random valuable out of this list, if you always want it to be 1, just remove the others
{
model = 'h4_prop_h4_necklace_01a',
heading = 308.06,
displayRotation = vector3(360.0, 0.0, 308.0),
rewards = {
items = {
{ item = 'diamond_necklace', label = 'Diamond Necklace', min = 1, max = 1 },
}
},
},
},
requiredItems = {
{ item = 'glass_cutter', label = 'Glass Cutter', amount = 1, remove = false },
},
},
},
},
},
vaults = {
vaultDoor = {
action = 'usb',
requiredItems = {
{ item = 'usb_stick', label = 'USB Stick', amount = 1, remove = false },
},
safes = {
{
coords = vector3(-442.1389, -69.4040, 40.2904),
heading = 218.7551,
grabModel = 'h4_prop_h4_diamond_01a',
requiredItems = {
{ item = 'safe_cracker', label = 'Safe Cracker', amount = 1, remove = false },
},
rewards = {
-- money = { type = 'bank', min = 0, max = 5000 },
items = {
{ item = 'ruby_diamond', label = 'Ruby Diamond', min = 1, max = 1 },
}
}
},
}
},
},
laserZones = { -- Uses mka_lasers
{
deactivate = vector3(-450.121, -57.776, 41.184),
lasers = { -- Only change these lasers if you have experience setting it up with mka_lasers
{
{vector3(-453.44, -78.225, 43.862), vector3(-461.223, -68.696, 43.862), vector3(-458.176, -66.155, 43.862), vector3(-461.241, -68.706, 43.862), vector3(-453.435, -78.195, 43.862)},
{vector3(-453.45, -78.3, 40.289), vector3(-461.403, -68.683, 40.289), vector3(-458.293, -66.24, 40.288), vector3(-461.404, -68.658, 40.289), vector3(-453.43, -78.291, 40.289)},
{travelTimeBetweenTargets = {1.0, 1.0}, waitTimeAtTargets = {0.0, 0.0}, name = "laser1"}
},
{
{vector3(-447.167, -73.106, 43.862), vector3(-454.934, -63.621, 43.862), vector3(-458.176, -66.156, 43.862), vector3(-454.939, -63.616, 43.862), vector3(-447.165, -73.116, 43.862)},
{vector3(-446.979, -73.312, 40.289), vector3(-455.159, -63.62, 40.289), vector3(-458.398, -66.51, 40.288), vector3(-455.175, -63.623, 40.289), vector3(-446.954, -73.312, 40.289)},
{travelTimeBetweenTargets = {1.0, 1.0}, waitTimeAtTargets = {0.0, 0.0}, name = "laser2"}
},
{
{vector3(-453.614, -73.665, 44.036), vector3(-451.598, -72.047, 44.036), vector3(-449.641, -74.543, 44.036), vector3(-451.549, -76.13, 44.036), vector3(-453.596, -73.68, 44.036)},
{vector3(-454.192, -74.147, 40.285), vector3(-451.117, -71.75, 40.285), vector3(-449.012, -74.846, 40.287), vector3(-451.529, -76.507, 40.287), vector3(-454.192, -74.151, 40.285)},
{travelTimeBetweenTargets = {1.0, 1.0}, waitTimeAtTargets = {0.0, 0.0}, name = "laser3"}
},
{
{vector3(-457.347, -69.048, 44.036), vector3(-455.384, -67.421, 44.036), vector3(-453.358, -69.909, 44.036), vector3(-455.285, -71.483, 44.036), vector3(-457.35, -69.052, 44.036)},
{vector3(-457.68, -68.791, 40.287), vector3(-455.419, -67.217, 40.287), vector3(-453.156, -69.47, 40.285), vector3(-456.073, -71.732, 40.285), vector3(-457.677, -68.792, 40.287)},
{travelTimeBetweenTargets = {1.0, 1.0}, waitTimeAtTargets = {0.0, 0.0}, name = "laser4"}
},
}
},
},
cameras = { -- Viewable cameras when the robbery is started
enabled = true,
open = {
everyone = false, -- If true, everyone can view the cameras, otherwise only the jobs below
jobs = { 'police', },
coords = vector3(-461.908, -66.894, 44.783),
rotation = vector3(0.0, 0.0, -149.0),
},
cams = {
{ x = -444.57061767578, y = -72.81893157959, z = 44.053528594971, r = { x = -35.0, y = 0.0, z = 74.939277648926 } },
{ x = -454.48120117188, y = -80.914535522461, z = 44.252041625977, r = { x = -35.0, y = -0.0, z = -2.2258901596069 } },
{ x = -463.28787231445, y = -69.816940307617, z = 44.314839172363, r = { x = -35.0, y = -0.0, z = -96.674835205078 } },
{ x = -453.95159912109, y = -62.196212768555, z = 44.259762573242, r = { x = -35.0, y = -0.0, z = 177.77383422852 } },
{ x = -449.78897094727, y = -56.765819549561, z = 44.262818145752, r = { x = -35.0, y = -0.0, z = 158.36546325684 } },
{ x = -445.90460205078, y = -61.849758148193, z = 44.026947784424, r = { x = -35.0, y = -0.0, z = 156.47560119629 } },
{ x = -443.92803955078, y = -70.473945617676, z = 43.555531311035, r = { x = -35.0, y = -0.0, z = -19.194046020508 } },
}
}
}
Config.End = {
death = { -- End robbery if player dies
enabled = true
},
distance = { -- End robbery if player goes out of distance
enabled = true,
radius = 150.0 -- Out of distance radius
},
timer = { -- End robbery if timer runs out
enabled = true,
seconds = 600,
show = true, -- Show timer to the robber
}
}
Config.Selling = {
enabled = true,
coords = vector3(-2282.8491, 255.0210, 183.6015),
npcModel = 'u_m_m_aldinapoli',
heading = 30.6874,
moneyType = 'bank',
items = { -- Items that can be sold
['ruby_diamond'] = { label = 'Ruby', price = 50000 }, -- Price is per 1
['van_gogh'] = { label = 'van Gogh', price = 25000 },
['diamond_necklace'] = { label = 'Diamond Necklace', price = 15000 },
['diamond_watch'] = { label = 'Diamond Watch', price = 750 },
['silver_watch'] = { label = 'Silver Watch', price = 600 },
['diamond_ring'] = { label = 'Diamond Ring', price = 500 },
['golden_ring'] = { label = 'Golden Ring', price = 250 },
['silver_ring'] = { label = 'Silver Ring', price = 100 },
}
}
Config.CopsNotifications = {
jobs = { 'police', },
onRobbertyStart = 'Vangelico is being robbed! Hurry!', -- put to false to disable (onRobbertyStart = false,)
}
--[[
ONLY CHANGE THIS PART IF YOU HAVE RENAMED SCRIPTS SUCH AS FRAMEWORK, TARGET, INVENTORY ETC
RENAME THE SCRIPT NAME TO THE NEW NAME
--]]
---@type table Only change these if you have changed the name of a resource
Resources = {
FM = { name = 'fmLib', export = 'new' },
OXTarget = { name = 'ox_target', export = 'all' },
QBTarget = { name = 'qb-target', export = 'all' },
MKALasers = { name = 'mka-lasers', export = false },
}
IgnoreScriptFoundLogs = false
Opensource Code
--[[
BY CrimeM Š crimem.com
--]]
function InitStartDoorTarget(obj)
if OXTarget then
OXTarget:addLocalEntity(obj, {
{
name = 'startRobbery', -- Do not change the name
label = 'Start Robbery',
icon = 'fas fa-gun',
distance = 2.5,
canInteract = function()
return GlobalState[State.ROBBERYSTATUS] == Status.NOTSTARTED
end,
onSelect = function()
TriggerServerEvent(_E('startRobbery'))
end
}
})
TargetEntities[obj] = 'startRobbery'
elseif QBTarget then
QBTarget:AddTargetEntity(obj, {
options = {
{
label = 'Start Robbery',
icon = 'fas fa-gun',
targeticon = 'fas fa-gun',
action = function()
TriggerServerEvent(_E('startRobbery'))
end,
canInteract = function()
return GlobalState[State.ROBBERYSTATUS] == Status.NOTSTARTED
end,
},
},
distance = 2.5,
})
TargetEntities[obj] = 'Start Robbery'
end
end
function InitSellingTarget(npc)
if OXTarget then
OXTarget:addLocalEntity(npc, {
{
label = 'Sell Loot',
icon = 'fas fa-dollar-sign',
distance = 2.5,
onSelect = function()
OpenSellingNPC()
end
}
})
elseif QBTarget then
QBTarget:AddTargetEntity(npc, {
options = {
{
label = 'Sell Loot',
icon = 'fas fa-dollar-sign',
targeticon = 'fas fa-dollar-sign',
action = function()
OpenSellingNPC()
end,
},
},
distance = 2.5,
})
end
end
function InitLaserDeactivationTarget(lZoneKey)
local zone = LaserZones[lZoneKey]
if not zone then Error('Laser zone not found with key: ' .. lZoneKey) return end
if OXTarget then
TargetZones[#TargetZones+1] = OXTarget:addSphereZone({
coords = zone.deactivate,
radius = 0.8,
debug = false,
drawSprite = true,
options = {
{
label = 'Deactivate Lasers',
icon = 'fas fa-power-off',
distance = 2.5,
canInteract = function()
return not DoingAction and not zone.deactivated
end,
onSelect = function()
DoingAction = true
if DisableLasersMinigame() then
TriggerServerEvent(_E('server:deactivateLaserZone'), lZoneKey)
end
DoingAction = false
end
}
}
})
elseif QBTarget then
local name = 'laser_deactivation'
TargetZones[#TargetZones+1] = name
QBTarget:AddCircleZone(name, zone.deactivate, 1.0, {
name = name,
debugPoly = false,
}, {
options = {
{
label = 'Deactivate Lasers',
icon = 'fas fa-power-off',
targeticon = 'fas fa-power-off',
action = function()
DoingAction = true
if DisableLasersMinigame() then
TriggerServerEvent(_E('server:deactivateLaserZone'), lZoneKey)
end
DoingAction = false
end,
canInteract = function()
return not DoingAction and not zone.deactivated
end
}
},
distance = 2.5,
})
end
end
function InitOpenCamerasTarget()
local openCam = Config.Robbery.cameras.open
if OXTarget then
TargetZones[#TargetZones+1] = OXTarget:addSphereZone({
coords = openCam.coords,
radius = 1.0,
debug = false,
drawSprite = true,
options = {
{
label = 'View Cameras',
icon = 'fas fa-video',
distance = 2.5,
canInteract = function()
return not DoingAction
end,
onSelect = function()
OpenCameras()
end
}
}
})
elseif QBTarget then
local name = 'open_cameras'
TargetZones[#TargetZones+1] = name
QBTarget:AddCircleZone(name, openCam.coords, 1.0, {
name = name,
debugPoly = false,
}, {
options = {
{
label = 'View Cameras',
icon = 'fas fa-video',
targeticon = 'fas fa-video',
action = function()
OpenCameras()
end,
canInteract = function()
return not DoingAction
end
}
},
distance = 2.5,
})
end
end
function InitLockedDoorTarget(obj, i, label, icon)
local door = Doors[i]
if not door then Error('Door not found with index: ' .. i) return end
if OXTarget then
OXTarget:addLocalEntity(obj, {
{
name = 'door', -- Do not change the name
label = label,
icon = icon,
distance = 2.5,
canInteract = function()
return InRobbery and not DoingAction and not Doors[i].opened
end,
onSelect = function()
OpenDoor(i)
end
}
})
TargetEntities[obj] = 'door'
elseif QBTarget then
QBTarget:AddTargetEntity(obj, {
options = {
{
label = label,
icon = icon,
targeticon = icon,
action = function()
OpenDoor(i)
end,
canInteract = function()
return InRobbery and not DoingAction and not Doors[i].opened
end,
},
},
distance = 2.5,
})
TargetEntities[obj] = label
end
end
---@param type 'trollies' | 'stacks' | 'paintings' | 'displays' | 'lockers' | 'safes' | 'smashes'
function InitLootTarget(type, obj, i, label)
local loot = GetLootByTypeAndIndex(type, i)
if OXTarget then
local options = {
{
name = type, -- Do not change the name
label = label,
icon = 'fas fa-hand',
distance = 2.5,
canInteract = function()
return not DoingAction and not loot.taken
end,
onSelect = function()
GrabLoot(type, i)
end
}
}
if type == 'stacks' or type == 'lockers' or type == 'smashes' then
TargetZones[#TargetZones+1] = OXTarget:addSphereZone({
coords = loot.coords,
radius = type == 'stacks' and 0.5 or 0.2,
debug = false,
drawSprite = true,
options = options
})
elseif obj then
OXTarget:addLocalEntity(obj, options)
TargetEntities[obj] = type
end
elseif QBTarget then
local options = {
{
label = label,
icon = 'fas fa-hand',
targeticon = 'fas fa-hand',
action = function()
GrabLoot(type, i)
end,
canInteract = function()
return not DoingAction and not loot.taken
end
}
}
if type == 'stacks' or type == 'lockers' then
local name = type..tostring(i)
TargetZones[#TargetZones+1] = name
QBTarget:AddCircleZone(name, loot.coords, type == 'stacks' and 0.5 or 0.2, {
name = name,
debugPoly = false,
}, {
options = options,
distance = 2.5,
})
else
QBTarget:AddTargetEntity(obj, {
options = options,
distance = 2.5,
})
TargetEntities[obj] = label
end
end
end
-- must return true or false
function DisableLasersMinigame()
if GetResourceState('utk_fingerprint') ~= 'started' or GetResourceState('utk_hackdependency') ~= 'started' then
return MinigameNotFoundFallback({ 'utk_fingerprint', 'utk_hackdependency' })
end
local res = promise.new()
TriggerEvent("utk_fingerprint:Start", 2, 4, 2, function(outcome, reason)
res:resolve(outcome)
end)
return Citizen.Await(res)
end
-- must return true or false
function USBHackMinigame()
if GetResourceState('ultra-keypackhack') ~= 'started' then
return MinigameNotFoundFallback({ 'ultra-keypackhack' })
end
local res = promise.new()
TriggerEvent('ultra-keypadhack', 6, 120, function(outcome, reason)
if outcome == 1 then
res:resolve(true)
else
res:resolve(false)
end
end)
return Citizen.Await(res)
end
-- must return true or false
function LaptopHackMinigame()
if GetResourceState('ultra-keypackhack') ~= 'started' then
return MinigameNotFoundFallback({ 'ultra-keypackhack' })
end
local res = promise.new()
TriggerEvent('ultra-keypadhack', 6, 120, function(outcome, reason)
if outcome == 1 then
res:resolve(true)
else
res:resolve(false)
end
end)
return Citizen.Await(res)
end
-- must return true or false
function DrillingMinigame()
if GetResourceState('fivem-drilling') ~= 'started' or GetResourceState('meta_libs') ~= 'started' then
return MinigameNotFoundFallback({ 'fivem-drilling', 'meta_libs' })
end
local res = promise.new()
TriggerEvent("Drilling:Start",function(success)
res:resolve(success)
end)
return Citizen.Await(res)
end
-- must return true or false
function CrackSafeMinigame()
if GetResourceState('ox_lib') ~= 'started' then
return MinigameNotFoundFallback({ 'ox_lib' })
end
local difficulties = {
'easy',
'medium',
-- 'hard',
}
return lib.skillCheck(difficulties, {'w', 'a', 's', 'd'})
end
-- must return true or false
function SmashGlassMinigame()
if GetResourceState('ox_lib') ~= 'started' then
return MinigameNotFoundFallback({ 'ox_lib' })
end
local difficulties = {
'easy',
'medium',
-- 'hard',
}
return lib.skillCheck(difficulties, {'w', 'a', 's', 'd'})
end
function OnPlayerLaserHit(playerBeingHit, hitPos)
if playerBeingHit then
StartScreenEffect('DeathFailNeutralIn', 0, false)
ApplyDamageToPed(PlayerPedId(), 20, true)
else
StopScreenEffect('DeathFailNeutralIn')
end
end
RegisterNetEvent(_E('notifyCops'), function(coords, msg)
local blip = AddBlipForCoord(coords.x, coords.y, coords.z)
SetBlipSprite(blip, 161)
SetBlipScale(blip, 1.0)
SetBlipColour(blip, 1)
SetBlipAsShortRange(blip, false)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString('Suspicious activity')
EndTextCommandSetBlipName(blip)
FM.utils.notify(msg, 'error')
Wait(20000)
RemoveBlip(blip)
end)
--[[
BY CrimeM Š crimem.com
--]]
Config.DiscordWebhook = ''
--[[
These events can be used to integrate other scripts etc.
If you register these events in other scripts make sure to change GetCurrentResourceName() to the name of this script.
Example: GetCurrentResourceName()..':onRobberyStarted' -> 'cm_pacificrobbery_gabz:onRobberyStarted'
--]]
RegisterNetEvent(GetCurrentResourceName()..':onRobberyStarted', function(playerId)
-- Code here
end)
RegisterNetEvent(GetCurrentResourceName()..':onRobberyEnded', function(success, reason)
-- Code here
end)
RegisterNetEvent(GetCurrentResourceName()..':onLootTaken', function(playerId, type, loot)
-- Code here
end)
RegisterNetEvent(GetCurrentResourceName()..':onDoorOpened', function(playerId, door)
-- Code here
end)
RegisterNetEvent(GetCurrentResourceName()..':onLaserZoneDeactivated', function(playerId, laserZone)
-- Code here
end)
function NotifyCops(jobs, msg, coords)
for _, jobName in ipairs(jobs) do
local cops = FM.utils.getPlayers({ job = jobName })
for src, p in pairs(cops) do
TriggerClientEvent(_E('notifyCops'), src, coords, msg)
end
end
end
function GetOnlineCopsAmount()
local copJobs = Config.MinimumCops.jobs
local total = 0
for i=1, #copJobs do
local amount = FM.utils.getPlayers({ job = copJobs[i], count = true })
total = total + amount
end
return total
end
Last updated