Accessible files
Here you can find all the files which can be edite to make the asset compatible with your server.
config.lua
----------------------------------------------------------------------------------------------
---------------------------------| Brutal Vehicle Heist :) |----------------------------------
----------------------------------------------------------------------------------------------
--[[
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 = 'automatic', -- All core settings are in the 'core' folder.
TextUI = 'brutal_textui', -- false / 'brutal_textui' / 'ox_lib' / 'okokTextUI' / 'ESXTextUI' / 'QBDrawText' // Custom can be add in the cl_utils.lua!!!
Target = 'oxtarget', -- 'oxtarget' / 'qb-target' // if the TextUI is set to false target will step its place. | The Target cannot be false.
ProgressBar = 'ox_lib', -- 'progressBars' / 'pogressBar' / 'mythic_progbar' / 'ox_lib' // Custom can be add in the cl_utils.lua!!!
BrutalNotify = true, -- Buy here: (4€+VAT) https://store.brutalscripts.com | Or set up your own notify >> cl_utils.lua
BrutalKeys = true, -- Buy here: (15€+VAT) https://store.brutalscripts.com | Or set up your own if you're using a different vehicle key >> client-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
SteamName = true, -- true = Steam name | false = character name
AllowedJobs = {'false'}, -- Set to 'false', if you don't want to use it.
BlacklistedJobs = {'false'}, -- Set to 'false', if you don't want to use it.
CopJobs = {'police', 'sheriff', 'fbi'}, -- Cop jobs
RequiredCopsCount = 0, -- This is how many cops are needed to be in the server to start a Heist
Cooldown = 15, -- The time between robberies | in minutes
HeistEndCoolDown = 100, -- The heist ends automatically when the time runs out (in minutes). Set to false to disable.
VehicleBlipRefresh = 8, -- Time (in seconds) between police blip updates for the fleeing vehicle.
ContainerBlipAlertDuration = 5, -- Time (in minutes) before the container alert blip disappears from the map.
TimerMenu = {
scrapdealer = {time = 5, title = 'Dealer Timer', description = 'Hurry! Talk to the dealer before the timer runs out.'},
sellzone = {time = 3, title = 'Sell Timer', description = 'Quick! Drop the stuff before it’s too late.'}
},
DefaultMiniGame = {
use = true, -- Set to false to disable the default minigame and add your own inside the MiniGame() function in cl_utils.lua.
remainingTime = 30, -- Time limit (in seconds) to complete the minigame.
controls = {
Horizontal = {label = "Change horizontal", keys = {174, 175}},
Vertical = {label = "Change vertical", keys = {172, 173}},
Exit = {label = "Exit", key = 194},
},
},
HeistItems = {
cutter = {remove = false, itemlabel = 'Cutter', itemname = 'container_cutter'},
bag = {required = false, itemlabel = 'Bag', itemname = 'bag'},
plateflipper = {remove = false, itemlabel = 'Plate Flipper', itemname = 'plateflipper', command = 'plateflipper'}, -- Use with an item or command. If you don't want to use it, just set it to false or 'false'.
},
RewardItems = {
coke = {itemlabel = 'Coke Brick', itemname = 'coke_brick', count = {10, 20}, sellPrice = 150},
door = {itemlabel = 'Vehicle Door', itemname = 'vehicle_door_part', sellPrice = 500},
hood = {itemlabel = 'Vehicle Hood', itemname = 'vehicle_hood', sellPrice = 800},
trunk = {itemlabel = 'Vehicle Trunk', itemname = 'vehicle_trunk', sellPrice = 600},
wheel = {itemlabel = 'Vehicle Wheel', itemname = 'vehicle_wheel', sellPrice = 400},
glass = {itemlabel = 'Glass pieces', itemname = 'glass_pieces', count = {2, 4}, sellPrice = 250},
},
Blips = {
boss = {use = true, label = 'Vehicle Heist', size = 1.0, sprite = 523, color = 1},
container = {label = 'Container Zone', size = 0.8, sprite = 677, color = 47, radiusblip = {radius = 50.0, color = 0}},
theftzone = {label = 'Theft Zone', size = 0.8, sprite = 227, color = 1, radiusblip = {radius = 50.0, color = 1}},
vehicle = {label = 'Vehicle', size = 1.0, sprite = 523, color = 5},
guard = {use = true, label = 'Enemy', size = 0.5, sprite = 1, color = 0},
big_alert = {label = 'Police Alert', size = 1.0, sprite = 161, color = 1},
small_alert = {label = 'Police Alert', size = 0.5, sprite = 227, color = 1},
scrapdealer = {label = 'Scrap Dealer', size = 1.0, sprite = 811, color = 31},
scrapzone = {label = 'Scrap Zone', size = 0.8, sprite = 566, color = 21, radiusblip = {radius = 30.0, color = 9}},
sellzone = {label = 'Sell Zone', size = 0.8, sprite = 272, color = 2, radiusblip = {radius = 50.0, color = 5}},
},
Markers = {
scrapzone = {use = true, marker = 36, rgb = {242, 189, 120}, bobUpAndDown = true, rotate = false},
deletezone = {use = true, marker = 20, rgb = {242, 189, 120}, bobUpAndDown = true, rotate = false}
},
Boss = {
model = 'a_m_y_soucent_02',
coords = vector4(-315.6174, -2698.7148, 7.5496, 316.7249),
},
Containers = {
[1] = {
coords = vector4(1041.1532, -2980.4111, 4.9010, 90.3355),
},
[2] = {
coords = vector4(943.7842, -3086.7256, 4.9008, 90.0570),
},
[3] = {
coords = vector4(928.8811, -2986.1138, 4.9012, 91.1255),
},
-- You can add more...
},
TheftZones = {
[1] = {
coords = vector4(1893.2214, 3887.3987, 32.7610, 122.0178),
vehicles = {
'adder',
'windsor',
'ztype',
'comet2',
'entity2',
'zentorno',
-- You can add more...
},
guards = {
-- armour: 0 to 100
[1] = {model = 'a_m_m_soucent_03', coords = vector4(1882.5610, 3894.8691, 32.9874, 141.3582), weapon = 'WEAPON_PISTOL', armour = 0},
[2] = {model = 'a_m_m_soucent_03', coords = vector4(1890.2784, 3882.8000, 33.1067, 106.5879), weapon = 'WEAPON_PISTOL', armour = 0},
[3] = {model = 'a_m_m_soucent_03', coords = vector4(1899.9192, 3896.3047, 32.8693, 155.6619), weapon = 'WEAPON_PISTOL', armour = 100},
[4] = {model = 'a_m_m_soucent_03', coords = vector4(1904.3590, 3891.8237, 32.7758, 115.8354), weapon = 'WEAPON_PISTOL', armour = 100},
-- You can add more...
},
},
[2] = {
coords = vector4(1666.1881, 4768.8857, 41.9664, 287.7531),
vehicles = {
'adder',
'windsor',
'ztype',
'comet2',
'entity2',
'zentorno',
-- You can add more...
},
guards = {
-- armour: 0 to 100
[1] = {model = 'a_m_m_soucent_03', coords = vector4(1663.8873, 4763.6733, 42.1262, 288.7094), weapon = 'WEAPON_PISTOL', armour = 0},
[2] = {model = 'a_m_m_soucent_03', coords = vector4(1653.7345, 4762.2876, 42.2018, 281.8503), weapon = 'WEAPON_PISTOL', armour = 0},
[3] = {model = 'a_m_m_soucent_03', coords = vector4(1663.6364, 4777.4351, 42.0050, 256.7112), weapon = 'WEAPON_PISTOL', armour = 100},
[4] = {model = 'a_m_m_soucent_03', coords = vector4(1659.6943, 4785.1172, 42.0604, 254.6746), weapon = 'WEAPON_PISTOL', armour = 100},
-- You can add more...
},
},
[3] = {
coords = vector4(954.5814, -201.2922, 73.1768, 331.1101),
vehicles = {
'adder',
'windsor',
'ztype',
'comet2',
'entity2',
'zentorno',
-- You can add more...
},
guards = {
-- armour: 0 to 100
[1] = {model = 'a_m_m_soucent_03', coords = vector4(969.7376, -196.2794, 73.2085, 44.4909), weapon = 'WEAPON_PISTOL', armour = 0},
[2] = {model = 'a_m_m_soucent_03', coords = vector4(964.7384, -204.4080, 73.2085, 13.3097), weapon = 'WEAPON_PISTOL', armour = 0},
[3] = {model = 'a_m_m_soucent_03', coords = vector4(958.2228, -207.4987, 73.0888, 328.6356), weapon = 'WEAPON_PISTOL', armour = 100},
[4] = {model = 'a_m_m_soucent_03', coords = vector4(956.9544, -196.3925, 73.1986, 244.9023), weapon = 'WEAPON_PISTOL', armour = 100},
-- You can add more...
},
},
-- You can add more...
},
ScrapZones = {
[1] = {
model = 's_m_m_gentransport',
coords = vector4(1961.5382, 5184.9185, 47.9766, 273.5093),
scrapzone = vector3(110.1070, 6627.1104, 31.7872),
deletezone = vector3(105.8674, 6627.4697, 31.7873),
sellzone = vector4(109.8472, 6631.2539, 31.7872, 180.2166),
},
[2] = {
model = 's_m_m_gentransport',
coords = vector4(839.3597, 2176.6689, 52.2896, 156.9895),
scrapzone = vector3(1174.7845, 2639.3484, 37.7543),
deletezone = vector3(1177.7452, 2636.2861, 37.7538),
sellzone = vector4(1172.1598, 2636.5132, 37.7956, 321.8000),
},
[3] = {
model = 's_m_m_gentransport',
coords = vector4(1130.2870, -776.7880, 57.6102, 4.7654),
scrapzone = vector3(731.8723, -1088.8248, 22.1690),
deletezone = vector3(737.3549, -1081.8710, 22.1687),
sellzone = vector4(733.7862, -1093.3649, 22.1690, 356.8713),
},
-- You can add more...
},
SellZones = {
[1] = {
model = 's_m_y_dealer_01',
coords = vector4(1754.1719, -1649.2654, 112.6560, 281.5396),
},
[2] = {
model = 's_m_y_dealer_01',
coords = vector4(420.4841, -2064.2415, 22.1437, 52.0229),
},
[3] = {
model = 's_m_y_dealer_01',
coords = vector4(-1153.4482, -1249.4305, 7.0191, 304.1535),
},
-- You can add more...
},
-----------------------------------------------------------
-----------------------| TRANSLATE |-----------------------
-----------------------------------------------------------
MoneyForm = '$', -- Money form
Locales = {
Door = 'Door',
FrontLeftDoor = 'Front Left Door',
RearLeftDoor = 'Rear Left Door',
RearRightDoor = 'Rear Right Door',
FrontRightDoor = 'Front Right Door',
Windscreen = 'Windscreen',
Hood = 'Hood',
Trunk = 'Trunk',
Wheel = 'Wheel',
FrontLeftWheel = 'Front Left Wheel',
RearLeftWheel = 'Rear Left Wheel',
RearRightWheel = 'Rear Right Wheel',
FrontRightWheel = 'Front Right Wheel',
},
Progressbar = {
Checking = {'Checking the body...', 4000}, -- text, time
Changing = {'Changing license plate...', 4000},
Removing = {'Removing...', 6000},
},
Texts = {
[1] = {'[E] - Speak with the Boss', 38, 'Speak with the Boss', 'fa-solid fa-user-tie'},
[2] = {'[E] - Check the body', 38, 'Check the body', 'fa-solid fa-magnifying-glass'},
[3] = {'[E] - Speak with the Dealer', 38, 'Speak with the Dealer', 'fa-solid fa-key'},
[4] = {'[E] - Change license plate', 38, 'Change license plate', 'fa-solid fa-screwdriver'},
[5] = {'[E] - Placed the vehicle', 38, 'Placed the vehicle', 'fa-solid fa-car'},
[6] = {'[E] - Remove', 38, 'Remove', 'fa-solid fa-xmark'},
[7] = {'[E] - Delete', 38, 'Delete', 'fa-solid fa-trash'},
[8] = {'[E] - Open Container', 38, 'Open Container', 'fa-solid fa-door-open'},
[9] = {'[E] - Hack Computer', 38, 'Hack Computer', 'fa-solid fa-computer'},
[10] = {'[E] - Grab Drugs', 38, 'Grab Drugs', 'fa-solid fa-hand'},
[11] = {'[E] - Sell the items', 38, 'Sell the items', 'fa-solid fa-user-secret'},
},
-- Notify function EDITABLE >> cl_utils.lua
Notify = {
[1] = {"Vehicle Heist", "The heist is already in progress.", 5000, "error"},
[2] = {"Vehicle Heist", "Not enough cops in the City!", 5000, 'error'},
[3] = {"Vehicle Heist", "There was a heist a while ago, please wait!", 5000, 'error'},
[4] = {"Vehicle Heist", "Your job is not on the allowed list.", 5000, "error"},
[5] = {"Vehicle Heist", "Your job is on the blacklist.", 5000, "error"},
[6] = {"Vehicle Heist", "The heist has started, go to the locations.", 5000, 'info'},
[7] = {"Vehicle Heist", "Check the armed people for the vehicle key.", 5000, 'info'},
[8] = {"Vehicle Heist", "Put the gun away!", 5000, 'error'},
[9] = {"Vehicle Heist", "You found the vehicle key.", 5000, 'success'},
[10] = {"Vehicle Heist", "No vehicle key found.", 5000, 'error'},
[11] = {"Vehicle Heist", "The keys aren't in the vehicle!", 5000, 'error'},
[12] = {"Vehicle Heist", "You can not do this in a vehicle!", 5000, 'error'},
[13] = {"Vehicle Heist", "The heist failed!", 5000, 'error'},
[14] = {"Vehicle Heist", "You can’t interact with the NPC until you’ve lost the cops. Change your license plate first", 10000, 'error'},
[15] = {"Vehicle Heist", "Your vehicle is no longer being tracked. You can now head to the Scrap Dealer.", 10000, 'success'},
[16] = {"Vehicle Heist", "You don't have the required item:", 5000, 'error'},
[17] = {"Vehicle Heist", "You're too far from the vehicle's plate!", 5000, 'error'},
[18] = {"Vehicle Heist", "Cops are tracking your vehicle. Change your license plate to hide.", 10000, 'info'},
[19] = {"Vehicle Heist", "Drive the stolen vehicle to the Scrap Zone.", 5000, 'info'},
[20] = {"Vehicle Heist", "Go to the marked location on your map and steal the vehicle.", 10000, 'info'},
[21] = {"Vehicle Heist", "You have successfully obtained the information.", 5000, 'success'},
[22] = {"Vehicle Heist", "You failed to obtain the information.", 5000, 'error'},
[23] = {"Vehicle Heist", "The container alarm went off. Leave the area now. You’ll get info soon on where to sell the drugs.", 10000, 'info'},
[24] = {"Vehicle Heist", "Sell the items in the designated place!", 5000, 'info'},
[25] = {"Vehicle Heist", "You got:", 5000, 'success'},
[26] = {"Vehicle Heist", "You sold:", 5000, 'success'},
[27] = {"Vehicle Heist", "You have nothing useful!", 5000, 'error'},
[28] = {"Vehicle Heist", "The heist has finished!", 5000, 'success'},
[29] = {"Vehicle Heist", "Sell the vehicle parts to the nearby NPC.", 5000, 'info'},
[30] = {"Vehicle Heist", "Take the vehicle apart and drop the parts off at the marked spot.", 10000, 'info'},
[31] = {"Vehicle Heist", "Do not leave the dismantling zone until you finish the heist!", 8000, 'info'},
},
Webhooks = {
DateFormat = '%d/%m/%Y - %X',
Locale = {
['heistProcess'] = '⌛ Heist started...',
['heistFinished'] = '✅ Heist finished.',
['HasStarted'] = 'started the Vehicle Heist!',
['HasFinished'] = 'finished the Vehicle Heist!',
['RobberHasQuit'] = '**The robber has quit the game!\nThe heist is 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
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
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')
elseif Config.TextUI:lower() == 'brutal_textui' then
exports['brutal_textui']:Open(text, "blue")
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()
elseif Config.TextUI:lower() == 'brutal_textui' then
exports['brutal_textui']:Close()
end
end
end
function ProgressBarFunction(time, text)
if Config.ProgressBar:lower() == 'progressbars' then --LINK: https://github.com/EthanPeacock/progressBars/releases/tag/1.0
exports['progressBars']:startUI(time, text)
Citizen.Wait(time)
elseif Config.ProgressBar:lower() == 'pogressbar' then -- LINK: https://github.com/SWRP-PUBLIC/pogressBar
exports['pogressBar']:drawBar(time, text)
Citizen.Wait(time)
elseif Config.ProgressBar:lower() == 'ox_lib' then
lib.progressBar({
duration = time,
label = text,
useWhileDead = false,
canCancel = true,
})
end
end
function MiniGame(cb)
if GetResourceState("ps-ui") == "started" then
exports['ps-ui']:Scrambler(function(success)
cb(success)
end, "alphanumeric", 60, 2)
else
print("^1[ERROR]^7 Minigame not configured or failed to initialize in ^3cl_utils.lua^7.")
cb(false)
end
end
function PlayerDied()
if GetResourceState("brutal_ambulancejob") == "started" then
return exports.brutal_ambulancejob:IsDead()
elseif GetResourceState("wasabi_ambulance") == "started" then
return exports.wasabi_ambulance:isPlayerDead()
else
if IsEntityDead(PlayerPedId()) then
return true
else
return false
end
end
end
function NoCarryWeapon()
if GetSelectedPedWeapon(PlayerPedId()) == GetHashKey('WEAPON_UNARMED') then
return true
else
SendNotify(8)
return false
end
end
RegisterNetEvent('brutal_vehicle_heist:client:PoliceAlert')
AddEventHandler('brutal_vehicle_heist:client:PoliceAlert', function(type, coords, notify)
if type == "Vehicle" then
if notify then
if GetResourceState("brutal_policejob") == "started" then
local streetLabel = GetStreetNameFromHashKey(GetStreetNameAtCoord(coords[1], coords[2], coords[3]))
TriggerServerEvent('brutal_policejob:server:citizencall', 'create', 'Robbery in progress', {coords[1], coords[2], coords[3]}, streetLabel)
end
notification('ROBBERY IN PROGRESS', 'A robbery is in progress. Location marked on your map!', 10000, 'info')
end
if BigAlertBlip then RemoveBlip(BigAlertBlip) BigAlertBlip = nil end
if SmallAlertBlip then RemoveBlip(SmallAlertBlip) SmallAlertBlip = nil end
BigAlertBlip = AddBlipForCoord(coords[1], coords[2], coords[3])
SetBlipSprite(BigAlertBlip, Config.Blips.big_alert.sprite)
SetBlipScale(BigAlertBlip, Config.Blips.big_alert.size)
SetBlipColour(BigAlertBlip, Config.Blips.big_alert.color)
BeginTextCommandSetBlipName('STRING')
AddTextComponentSubstringPlayerName(Config.Blips.big_alert.label)
EndTextCommandSetBlipName(BigAlertBlip)
SmallAlertBlip = AddBlipForCoord(coords[1], coords[2], coords[3])
SetBlipSprite(SmallAlertBlip, Config.Blips.small_alert.sprite)
SetBlipScale(SmallAlertBlip, Config.Blips.small_alert.size)
SetBlipColour(SmallAlertBlip, Config.Blips.small_alert.color)
BeginTextCommandSetBlipName('STRING')
AddTextComponentSubstringPlayerName(Config.Blips.small_alert.label)
EndTextCommandSetBlipName(SmallAlertBlip)
elseif type == "Container" then
if GetResourceState("brutal_policejob") == "started" then
local streetLabel = GetStreetNameFromHashKey(GetStreetNameAtCoord(coords[1], coords[2], coords[3]))
TriggerServerEvent('brutal_policejob:server:citizencall', 'create', 'Robbery in progress', {coords[1], coords[2], coords[3]}, streetLabel)
end
notification('ROBBERY IN PROGRESS', 'A robbery is in progress. Location marked on your map!', 10000, 'info')
BigAlertBlip = AddBlipForCoord(coords[1], coords[2], coords[3])
SetBlipSprite(BigAlertBlip, Config.Blips.big_alert.sprite)
SetBlipScale(BigAlertBlip, Config.Blips.big_alert.size)
SetBlipColour(BigAlertBlip, Config.Blips.big_alert.color)
BeginTextCommandSetBlipName('STRING')
AddTextComponentSubstringPlayerName(Config.Blips.big_alert.label)
EndTextCommandSetBlipName(BigAlertBlip)
Citizen.Wait(1000*60*Config.ContainerBlipAlertDuration)
RemoveBlip(BigAlertBlip)
end
end)
RegisterNetEvent('brutal_vehicle_heist:client:DeletePoliceAlert')
AddEventHandler('brutal_vehicle_heist:client:DeletePoliceAlert', function()
if BigAlertBlip ~= nil then RemoveBlip(BigAlertBlip) end
if SmallAlertBlip ~= nil then RemoveBlip(SmallAlertBlip) end
end)
RegisterNetEvent('brutal_vehicle_heist:client:utils:CreateVehicle')
AddEventHandler('brutal_vehicle_heist:client:utils:CreateVehicle', function(Vehicle)
local plate = GetVehicleNumberPlateText(Vehicle)
SetVehicleFuelLevel(Vehicle, 100.0)
DecorSetFloat(Vehicle, "_FUEL_LEVEL", GetVehicleFuelLevel(Vehicle))
if Config.BrutalKeys and GetResourceState("brutal_keys") == "started" then
exports.brutal_keys:addVehicleKey(plate, plate)
end
if Config['Core']:upper() == 'QBCORE' then
TriggerEvent("vehiclekeys:client:SetOwner", QBCore.Functions.GetPlate(Vehicle))
end
end)
RegisterNetEvent('brutal_vehicle_heist:client:utils:DeleteVehicle')
AddEventHandler('brutal_vehicle_heist:client:utils:DeleteVehicle', function(Vehicle, DeleteVehicleModel)
local plate = GetVehicleNumberPlateText(Vehicle)
if Config.BrutalKeys and GetResourceState("brutal_keys") == "started" then
exports.brutal_keys:removeKey(plate, true)
end
if DeleteVehicleModel then
TriggerServerEvent('brutal_vehicle_heist:server:deleteEntitys', 'Vehicle')
end
end)
server-utils.lua
local YourWebhook = 'WEBHOOK-HERE' -- help: https://docs.brutalscripts.com/site/others/discord-webhook
function GetWebhook()
return YourWebhook
end
RegisterServerEvent('brutal_vehicle_heist:server:PoliceAlert')
AddEventHandler('brutal_vehicle_heist:server:PoliceAlert', function(type, coords, notify)
local Players = GetPlayersFunction()
for i = 1, #Players do
for ii=1, #Config.CopJobs do
if GetPlayerJob(Players[i]) == Config.CopJobs[ii] then
if type ~= nil then
TriggerClientEvent('brutal_vehicle_heist:client:PoliceAlert', Players[i], type, coords, notify)
else
TriggerClientEvent('brutal_vehicle_heist:client:DeletePoliceAlert', Players[i])
end
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 GetResourceState("es_extended") == "started" 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
function GetPlayerJobDatas()
return Core.GetPlayerData().job
end
function GetPlayersFunction()
return Core.Game.GetPlayers()
end
function GetVehiclePropertiesFunction(vehicle)
return Core.Game.GetVehicleProperties(vehicle)
end
function SetVehiclePropertiesFunction(vehicle, properties)
return Core.Game.SetVehicleProperties(vehicle, properties)
end
function GetClosestVehicleFunction(coords, modelFilter)
return Core.Game.GetClosestVehicle(coords, modelFilter)
end
elseif GetResourceState("qb-core") == "started" or GetResourceState("qbx_core") == "started" then
Core = exports['qb-core']:GetCoreObject()
LoadedEvent = 'QBCore:Client:OnPlayerLoaded'
TSCB = Core.Functions.TriggerCallback
function GetPlayerJobDatas()
return Core.Functions.GetPlayerData().job
end
function GetPlayersFunction()
return Core.Functions.GetPlayers()
end
function GetVehiclePropertiesFunction(vehicle)
return Core.Functions.GetVehicleProperties(vehicle)
end
function SetVehiclePropertiesFunction(vehicle, properties)
return Core.Functions.SetVehicleProperties(vehicle, properties)
end
function GetClosestVehicleFunction(coords, modelFilter)
return Core.Functions.GetClosestVehicle(coords, modelFilter)
end
end
server-core.lua
Core = nil
if GetResourceState("es_extended") == "started" then
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 GetIdentifier(source)
local xPlayer = GETPFI(source)
while xPlayer == nil do
Citizen.Wait(1000)
xPlayer = GETPFI(source)
end
return xPlayer.identifier
end
function GetPlayerByIdentifier(identifier)
return Core.GetPlayerFromIdentifier(identifier)
end
function AddMoneyFunction(source, amount)
local xPlayer = GETPFI(source)
xPlayer.addAccountMoney('money', amount) -- NORMAL MONEY
--xPlayer.addAccountMoney('black_money', amount) -- BLACK MONEY
end
function GetItemCount(source, item)
local xPlayer = GETPFI(source)
if _esx_ == 'new' then
if xPlayer.getInventoryItem(item) == nil then
print("^1PROBLEM!^7 The ^3" ..item.. "^7 item is not created.")
return 0
end
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 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 AddItem(source, item, count, info)
local xPlayer = GETPFI(source)
if _esx_ == 'new' then
xPlayer.addInventoryItem(item, count, info)
else
if string.sub(item, 0, 6):lower() == 'weapon' then
xPlayer.addWeapon(item, 90)
else
xPlayer.addInventoryItem(item, count)
end
end
end
function GetPlayerNameFunction(source)
local name
if Config.SteamName then
name = GetPlayerName(source) or 'No Data'
else
local xPlayer = GETPFI(source)
name = xPlayer.getName() or 'No Data'
end
return name
end
function GetPlayerJob(source)
local xPlayer = GETPFI(source)
if xPlayer ~= nil then
PlayerJob = xPlayer.job.name
else
PlayerJob = ''
end
return PlayerJob
end
function GetPlayersFunction()
return Core.GetPlayers()
end
elseif GetResourceState("qb-core") == "started" or GetResourceState("qbx_core") == "started" then
Core = exports['qb-core']:GetCoreObject()
RESCB = Core.Functions.CreateCallback
GETPFI = Core.Functions.GetPlayer
RUI = Core.Functions.CreateUseableItem
function GetIdentifier(source)
local xPlayer = GETPFI(source)
while xPlayer == nil do
Citizen.Wait(1000)
xPlayer = GETPFI(source)
end
return xPlayer.PlayerData.citizenid
end
function GetPlayerByIdentifier(identifier)
return Core.Functions.GetPlayerByCitizenId(identifier)
end
function AddMoneyFunction(source, amount)
local xPlayer = GETPFI(source)
xPlayer.Functions.AddMoney('cash', amount)
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 RemoveItem(source, item, amount)
local xPlayer = GETPFI(source)
xPlayer.Functions.RemoveItem(item, amount)
end
function AddItem(source, item, count, info)
local xPlayer = GETPFI(source)
xPlayer.Functions.AddItem(item, count, nil, info)
end
function GetPlayerNameFunction(source)
local name
if Config.SteamName then
name = GetPlayerName(source)
else
local xPlayer = GETPFI(source)
name = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname
end
return name
end
function GetPlayerJob(source)
local xPlayer = GETPFI(source)
return xPlayer.PlayerData.gang.name
end
function GetPlayersFunction()
return Core.Functions.GetPlayers()
end
end
Last updated
Was this helpful?