Configuration
shared.lua
Framework Configuration
Config, Noti, Lang = {}, {}, {}
-- Use "esx" or "qb"
Config.Framework = "qb"
-- If you are using one of the most recent versions of ESX, set the script name. Default = "es_extended"
Config.ESXExport = "es_extended"
-- Default ESX: "esx:getSharedObject" | Default QB: "qb-core"
Config.Core = "qb-core"
-- Set to true to enable debug mode
Config.debug = false
-- Key to get up if sitAndLay is true (default: "X")
Config.KeyToGetUp = 73
Actions
Enable or disable individual actions:
Actions = {
sitAndLay = true,
hidrants = true,
traffic_lights = true,
vending_machines = true,
beach_fire = true,
phone_booths = true,
garbage = true,
animals = true,
telescopes = true,
flat_tires = true,
kick_trash = true,
hostage_player = true,
hostage_npc = true,
food_trucks = true,
shoplifting = true,
carry_things = true,
barriers = true,
user_id = true,
talk_with_npc = true,
rob_npc = true,
custom = true
}
Notifications
function notifications(notitype, message, time)
-- Change this trigger for your notification system keeping the variables
TriggerEvent("codem-notification", message, time, notitype)
end
-- Notifications types:
Noti.info = "info"
Noti.check = "check"
Noti.error = "error"
-- Notification time:
Noti.time = 5000
Stress System
--Set to true if you want to use the stress system.
Config.useStress = true
function stress(stressLevel)
-- If you use any stress system you can add here what is necessary to decrease the stress when the player is seated.
end
Target Configuration
Config.Target = "qb-target"
function target(elements, options)
exports["qb-target"]:AddTargetModel(
elements,
{
options = options,
distance = 3.0
}
)
end
function targetBoxZone(store, options, location)
exports["qb-target"]:AddBoxZone(
"store-" .. tonumber(store),
vector3(location.x, location.y, location.z),
1.7,
1.0,
{
name = "store-" .. tonumber(store),
heading = location.w,
minZ = location.z - 1,
maxZ = location.z + 1
},
{
options = options,
distance = 1.5
}
)
end
function targetPlayer(options)
exports["qb-target"]:AddGlobalPlayer(
{
options = options,
distance = 3.0
}
)
end
function targetNPC(options)
exports["qb-target"]:AddGlobalPed(
{
options = options,
distance = 3.0
}
)
end
function bones(bones, options)
exports["qb-target"]:AddTargetBone(
bones,
{
options = options,
distance = 1
}
)
end
BIT-Interact Configuration
Config.useInteract = true
function interact()
TriggerEvent("bit-interact:Start", "X", "To get up")
end
Icons
Config.icons = {
sit = "fas fa-chair",
lay = "fas fa-bed",
manipulate = "fas fa-hands",
pistol = "fas fa-gun",
talk = "fas fa-comment"
}
Vending Machines
Configure items and prices for vending machines:
DrinkMachines = {
{
event = "buycola",
icon = Config.icons.manipulate,
label = "Buy Cola (10$)",
price = 10,
giveItem = "kurkakola"
},
{
event = "buysprunk",
icon = Config.icons.manipulate,
label = "Buy Sprunk (10$)",
price = 10,
giveItem = "sprunk"
},
{
event = "buywater",
icon = Config.icons.manipulate,
label = "Buy water (10$)",
price = 10,
giveItem = "water_bottle"
}
}
CoffeeMachines = {
{
event = "buycoffee",
icon = Config.icons.manipulate,
label = "Buy coffee (10$)",
price = 10,
giveItem = "coffee"
}
}
WaterMachines = {
{
event = "buywater",
icon = Config.icons.manipulate,
label = "Buy water (5$)",
price = 5,
giveItem = "water_bottle"
}
}
SnacksMachines = {
{
event = "buytwerks",
icon = Config.icons.manipulate,
label = "Buy Twerks (10$)",
price = 10,
giveItem = "twerks"
},
{
event = "buysnikkel",
icon = Config.icons.manipulate,
label = "Buy Snikkel (10$)",
price = 10,
giveItem = "snikkel"
}
}
Food Trucks
FoodTrucks = {
{
event = "buyhotdog",
icon = Config.icons.manipulate,
label = "Buy Hot Dog (10$)",
price = 10,
giveItem = "hotdog"
},
{
event = "buyhamburger",
icon = Config.icons.manipulate,
label = "Buy Hamburger (10$)",
price = 10,
giveItem = "hamburger"
},
{
event = "buysandwich",
icon = Config.icons.manipulate,
label = "Buy Sandwich (10$)",
price = 10,
giveItem = "sandwich"
}
}
Dispatch Configuration
Config.policejob = "police"
Config.ambulancejob = "ambulance"
Config.mechanicjob = "mechanic"
Config.taxijob = "taxi"
function dispatch(job, title, message)
-- Example with cd_dispatch:
--[[ local data = exports["cd_dispatch"]:GetPlayerInfo()
TriggerServerEvent(
"cd_dispatch:AddNotification",
{
job_table = {job},
coords = data.coords,
title = title,
message = "Requires assistance " .. data.street,
flash = 0,
unique_id = tostring(math.random(0000000, 9999999)),
blip = {
sprite = 431,
scale = 1.2,
colour = 3,
flashes = false,
text = message,
time = 5,
sound = 1
}
}
) ]]
notifications(Noti.info, Lang.dispatchDone .. " " .. job, Noti.time)
end
Garbage Search
GarbageAmount = {
min = 1,
max = 5
}
RandomItems = {
"cigarette",
"chain",
"rope",
"tech_parts",
"spring",
"rubber",
"brokenknife",
"lighter"
}
Flat Tires
Config.allowedWeapons = {
"WEAPON_DAGGER",
"WEAPON_BOTTLE",
"WEAPON_HATCHET",
"WEAPON_SWITCHBLADE",
"WEAPON_MACHETE",
"WEAPON_KNIFE"
}
Hostage System
Config.hostageAllowedWeapons = {
"WEAPON_PISTOL",
"WEAPON_COMBATPISTOL",
"WEAPON_GLOCK",
"WEAPON_HEAVYPISTOL",
"WEAPON_SNSPISTOL",
"WEAPON_VINTAGEPISTOL",
"WEAPON_APPISTOL"
}
Shoplifting
-- Percentage chance to succeed in stealing something in the store
Config.chance = 90
-- Cooldown time in minutes
Config.cooldown = 5
-- Police alert
Config.policeAlertChance = 0.5
StoresLocations = {
[1] = vector4(30.94, -1345.33, 29.51, 271.66),
[2] = vector4(28.21, -1345.191, 29.51, 271.66),
[3] = vector4(-709.75, -912.34, 19.26, 131.63),
[4] = vector4(-713.7043, -913.0905, 19.28019, 131.63),
[5] = vector4(-712.2653, -911.6414, 19.2957, 131.63),
[6] = vector4(-715.6313, -911.6693, 19.29983, 131.63)
}
ShopliftingItems = {
"water_bottle"
}
Rob NPC
-- Cooldown time in seconds
Config.cooldown = 0
-- "money" or "item"
Config.giveMoneyOrItem = "money"
-- Random item to rob
RobItem = {
"lighter",
"cola"
}
-- Random money amount to rob
RobMoney = {
min = 100,
max = 500
}
MLO Configuration
Set true or false to enable or disable the sit/lay down in the following MLOs:
MLO = {
coroner = true,
lscustoms = false,
mrpd = false,
pacific_standard = false,
paleto_bank = false,
paleto_so = false,
pdm = false,
sandy_so = false,
submarine = false,
tattoo_shops = true,
tequilala = true,
trevors_trailer = true,
vanilla_unicorn = false,
-- And many more Gabz MLOs...
}
Carry Objects Configuration
-- If you want to see the xOffset, yOffset, zOffset, xRot, yRot, zRot of the entity you are carrying
-- and use keys to edit the positions and rotations, set this to true.
-- More info: https://docs.bit-code.dev/
Config.carryDebug = false
carryEntities = {
[-1386777370] = {
dict = "anim@heists@box_carry@",
anim = "idle",
xOffset = 0.87,
yOffset = -0.62,
zOffset = 0.37,
xRot = -18.0,
yRot = 112.0,
zRot = 128.0
},
-- More entities...
}
Custom Entities
Add custom interactions to any prop:
customEntities = {
[-639994124] = {
-- Prop hash
options = {
{
icon = Config.icons.manipulate, -- Icon for the target option
label = "Custom", -- Label for the target option
action = function(entity)
if DoesEntityExist(entity) then
-- Do something with the entity
--[[
Example:
loadAnimation("mini@repair")
TaskPlayAnim(PlayerPedId(), "mini@repair", "fixing_a_ped", 4.0, 1.0, -1, 49, 0, 0, 0, 0)
Citizen.Wait(5000)
ClearPedTasks(PlayerPedId()) ]]
end
end
}
}
}
}
sconfig.lua
Server-side callbacks for money and item management:
if Config.Framework == "esx" then
Citizen.Wait(3000)
ESX.RegisterServerCallback(
"bit-interactivecity:getMoney",
function(source, cb)
local xPlayer = ESX.GetPlayerFromId(source)
money = xPlayer.getMoney()
cb(money)
end
)
else
Citizen.Wait(3000)
QBCore.Functions.CreateCallback(
"bit-interactivecity:getMoney",
function(source, cb)
local xPlayer = QBCore.Functions.GetPlayer(source)
money = xPlayer.Functions.GetMoney("cash")
cb(money)
end
)
end
RegisterNetEvent("bit-interactivecity:removeMoney")
AddEventHandler(
"bit-interactivecity:removeMoney",
function(playerID, amount)
if Config.Framework == "esx" then
local xPlayer = ESX.GetPlayerFromId(playerID)
xPlayer.removeMoney(amount)
else
local xPlayer = QBCore.Functions.GetPlayer(playerID)
xPlayer.Functions.RemoveMoney("cash", amount)
end
end
)
RegisterNetEvent("bit-interactivecity:giveItem")
AddEventHandler(
"bit-interactivecity:giveItem",
function(playerID, item, amount)
if Config.Framework == "esx" then
local xPlayer = ESX.GetPlayerFromId(playerID)
if amount == nil then
xPlayer.addInventoryItem(item, 1)
else
xPlayer.addInventoryItem(item, amount)
end
else
local xPlayer = QBCore.Functions.GetPlayer(playerID)
if amount == nil then
xPlayer.Functions.AddItem(item, 1)
else
xPlayer.Functions.AddItem(item, amount)
end
end
end
)
RegisterNetEvent("bit-interactivecity:giveMoney")
AddEventHandler(
"bit-interactivecity:giveMoney",
function(playerID, amount)
if Config.Framework == "esx" then
local xPlayer = ESX.GetPlayerFromId(playerID)
xPlayer.addMoney(amount)
else
local xPlayer = QBCore.Functions.GetPlayer(playerID)
xPlayer.Functions.AddMoney("cash", amount)
end
end
)