đConfigurables
In this page, you can see everything that can be configured/changed within this script.
Config files
--[[
BY RX Scripts Š rxscripts.xyz
--]]
Config = {}
Config.DiscordWebhook = ''
Config.Locale = 'en'
Config.SellPercentage = 0.75 -- Percentage of the store price to return to the player when selling
Config.ImgDirectory = 'ox_inventory/web/images/' -- The directory where the images are stored.
Config.StoreTypes = {
['supermarket'] = {
allowedItems = { -- Removing this table makes it possible to stock & sell all existing items in your serve, it disables the ordering system
['water'] = { -- Allowed to stock & sell item: 'water'
minPrice = 10, -- Minimum price the item must be sold for
maxPrice = 20, -- Maximum price the item can be sold for
maxOrder = 10, -- Maximum amount of the item that can be ordered at once (JOBS DLC)
orderPrice = 5, -- Price for ordering the item (1x) (JOBS DLC)
},
['burger'] = { -- Allowed to stock & sell item: 'bread'
minPrice = 10, -- Minimum price the item must be sold for
maxPrice = 20, -- Maximum price the item can be sold for
maxOrder = 10, -- Minimum amount of the item that can be ordered at once (JOBS DLC)
orderPrice = 5, -- Price for ordering the item (1x) (JOBS DLC)
},
},
cooldowns = {
delivery = 1800, -- Cooldown in seconds for the delivery job (JOBS DLC)
order = 1800, -- Cooldown in seconds for the order job (JOBS DLC)
},
blip = {
enabled = true,
sprite = 59,
color = 2,
scale = 0.8,
display = 4,
shortRange = true,
},
security = { -- Security adds logs for all managing actions & robberies, also makes the robbery take longer & pay less.
price = 100000,
robberyDuration = 300, -- Duration in seconds with security
robberyStealPercentage = 0.15, -- Percentage of the store's balance that will be stolen with security
robberyCooldown = 3600, -- Cooldown in seconds for the robbery when the store has security
robberyExtraRequiredItems = { -- Extra required items for the robbery with security
'WEAPON_ASSAULTRIFLE',
},
},
},
['gunstore'] = {
allowedItems = {
['WEAPON_CROWBAR'] = { minPrice = 1000, maxPrice = 5000, orderPrice = 500, maxOrder = 3 },
['WEAPON_BAT'] = { minPrice = 1000, maxPrice = 5000, orderPrice = 500, maxOrder = 3 },
['WEAPON_KNIFE'] = { minPrice = 1000, maxPrice = 5000, orderPrice = 500, maxOrder = 3 },
['WEAPON_PISTOL'] = { minPrice = 10000, maxPrice = 20000, orderPrice = 5000, maxOrder = 3 },
['WEAPON_HEAVYPISTOL'] = { minPrice = 10000, maxPrice = 20000, orderPrice = 5000, maxOrder = 3 },
['WEAPON_MINISMG'] = { minPrice = 50000, maxPrice = 150000, orderPrice = 25000, maxOrder = 3 },
['WEAPON_MICROSMG'] = { minPrice = 50000, maxPrice = 150000, orderPrice = 25000, maxOrder = 3 },
['WEAPON_ASSAULTRIFLE'] = { minPrice = 50000, maxPrice = 150000, orderPrice = 25000, maxOrder = 3 },
},
cooldowns = {
delivery = 1800, -- Cooldown in seconds for the delivery job (JOBS DLC)
order = 1800, -- Cooldown in seconds for the order job (JOBS DLC)
},
blip = {
enabled = true,
sprite = 59,
color = 2,
scale = 0.8,
display = 4,
shortRange = true,
},
security = {
price = 100000,
robberyDuration = 300,
robberyStealPercentage = 0.15,
robberyCooldown = 3600,
robberyExtraRequiredItems = {
'WEAPON_ASSAULTRIFLE',
},
},
},
['pawnshop'] = {
blacklistedItems = { -- Assuming there is no allowedItems, any item can be added & sold. Except for the items in this table
'money',
'dirty_money',
'black_money',
'cash',
},
cooldowns = {
delivery = 1800, -- Cooldown in seconds for the delivery job (JOBS DLC)
},
blip = {
enabled = true,
sprite = 59,
color = 30,
scale = 0.8,
display = 4,
shortRange = true,
},
security = {
price = 100000,
robberyDuration = 300,
robberyStealPercentage = 0.15,
robberyCooldown = 3600,
robberyExtraRequiredItems = {
'WEAPON_ASSAULTRIFLE',
}
}
},
['illegalstore'] = {
blacklistedItems = {
'money',
'dirty_money',
'black_money',
'cash',
},
cooldowns = {
delivery = 1800, -- Cooldown in seconds for the delivery job (JOBS DLC)
},
blip = {
enabled = true,
sprite = 59,
color = 30,
scale = 0.8,
display = 4,
shortRange = true,
},
security = {
price = 100000,
robberyDuration = 300,
robberyStealPercentage = 0.15,
robberyCooldown = 3600,
robberyExtraRequiredItems = {
'WEAPON_ASSAULTRIFLE',
}
}
},
}
Config.Robbery = {
enabled = true,
minCops = 1,
copsJobs = {
'police',
},
duration = 120, -- Duration in seconds without security
stealPercentage = 0.3, -- Percentage of the store's balance that will be stolen without security
requiredItems = {
'WEAPON_PISTOL',
},
cooldown = 1800, -- Cooldown in seconds for the robbery
}
Config.EmployeeRanks = {
[1] = {
label = "Associate",
perms = {
-- Inventory Perms
addStock = true, -- Add stock/inventory to the store
removeStock = false, -- Remove stock/inventory from the store
price = false, -- Change prices of items in the store
-- Job Perms
orders = true, -- Order & collect jobs for the store
deliveries = true, -- Delivery jobs for the store
-- Managing Perms
buySecurity = false, -- Buy security for the store
deposit = true, -- Deposit money into the store
openClose = false, -- Open/Close the store
withdraw = false, -- Withdraw money from the store
clearLogs = false, -- Clear the logs of the store
-- Employee Manage Perms
employees = false, -- Hire, promote, demote & fire employees
salaries = false, -- Manage salaries for employees
}
},
[2] = {
label = "Employee",
perms = {
-- Inventory Perms
addStock = true,
removeStock = false,
price = false,
-- Job Perms
orders = true,
deliveries = true,
-- Managing Perms
buySecurity = false,
deposit = true,
openClose = true,
withdraw = false,
clearLogs = false,
-- Employee Manage Perms
employees = false,
salaries = false,
}
},
[3] = {
label = "Manager",
perms = {
-- Inventory Perms
addStock = true,
removeStock = true,
price = true,
-- Job Perms
orders = true,
deliveries = true,
-- Managing Perms
buySecurity = true,
deposit = true,
openClose = true,
withdraw = false,
clearLogs = true,
-- Employee Manage Perms
employees = true,
salaries = false,
}
},
[4] = { -- Boss perms are changeable too, so you can decide to disable some of the possibilities.
label = "Boss",
perms = {
-- Inventory Perms
addStock = true,
removeStock = true,
price = true,
-- Job Perms
orders = true,
deliveries = true,
-- Managing Perms
buySecurity = true,
deposit = true,
openClose = true,
withdraw = true,
clearLogs = true,
-- Employee Manage Perms
employees = true,
salaries = true,
}
},
}
Config.MoneyTypes = {
buyStore = 'bank',
sellStore = 'bank',
deposit = 'bank',
withdraw = 'bank',
robStore = 'bank',
buyCash = 'money',
buyBank = 'bank',
}
Config.Commands = {
create = 'ps:create',
}
--[[
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' },
KQLasers = { name = 'kq_lasers', export = 'all' },
JobsDLC = { name = 'RxD_Jobs', export = 'all' },
}
IgnoreScriptFoundLogs = false
Opensource files
--[[
BY RX Scripts Š rxscripts.xyz
--]]
function ShowHelpNotification(msg, thisFrame, beep, duration)
AddTextEntry('helpNotification', msg)
if thisFrame then
DisplayHelpTextThisFrame('helpNotification', false)
else
if beep == nil then
beep = true
end
BeginTextCommandDisplayHelp('helpNotification')
EndTextCommandDisplayHelp(0, false, beep, duration or -1)
end
end
function ShowMarker(type, coords)
if type == 'openStore' then
DrawMarker(2, coords, 0, 0, 0, 0, 180.0, 0, 0.3, 0.3, 0.3, 0, 200, 0, 100, false, false, 2, true, false, false, false)
elseif type == 'closedStore' then
DrawMarker(2, coords, 0, 0, 0, 0, 180.0, 0, 0.3, 0.3, 0.3, 200, 0, 0, 100, false, false, 2, true, false, false, false)
elseif type == 'buyStore' then
DrawMarker(29, coords, 0, 0, 0, 0, 180.0, 0, 0.5, 0.5, 0.5, 200, 200, 0, 100, false, false, 2, true, false, false, false)
elseif type == 'manageStore' then
DrawMarker(2, coords, 0, 0, 0, 0, 180.0, 0, 0.3, 0.3, 0.3, 0, 200, 0, 100, false, false, 2, true, false, false, false)
elseif type == 'robStore' then
DrawMarker(29, coords, 0, 0, 0, 0, 180.0, 0, 0.5, 0.5, 0.5, 200, 0, 0, 100, false, false, 2, true, false, false, false)
end
end
RegisterNetEvent('ps: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(_L('store_robbery'))
EndTextCommandSetBlipName(blip)
FM.utils.notify(msg, 'error')
Wait(20000)
RemoveBlip(blip)
end)
-- IF using KQ LASERS you can add them here manually
local lasers = {}
function StartLasers(store, onHit)
local laserData = {
maxLength = 250.0,
damage = 5,
ragdoll = true,
active = true,
handler = onHit,
}
-- Check which store it is
if store.id == '1' then
-- Copy this part & change the coords (coords are gettable by using /laser_place in-game)
laserData.origin = vector3(-47.242821, -1760.325806, 31.662683)
laserData.endPoint = vector3(-53.0845, -1746.8290, 28.4210)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
laserData.origin = vector3(-57.216446, -1752.103516, 31.627932)
laserData.endPoint = vector3(-42.589355, -1755.212036, 28.879730)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
end
if store.id == '2' then
-- Copy this part & change the coords (coords are gettable by using /laser_place in-game)
laserData.origin = vector3(15.655594, -1113.600098, 31.946823)
laserData.endPoint = vector3(23.485664, -1106.687500, 29.979176)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
end
if store.id == '4' then
-- Copy this part & change the coords (coords are gettable by using /laser_place in-game)
laserData.origin = vector3(34.733490, -1349.023682, 31.660732)
laserData.endPoint = vector3(31.311775, -1342.681885, 29.166174)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
laserData.origin = vector3(23.539112, -1342.019653, 31.895357)
laserData.endPoint = vector3(30.685148, -1344.353882, 29.304596)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
end
if store.id == '5' then
-- Copy this part & change the coords (coords are gettable by using /laser_place in-game)
laserData.origin = vector3(-1225.056396, -911.190979, 14.623931)
laserData.endPoint = vector3(-1223.047607, -905.739014, 11.952926)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
end
if store.id == '6' then
-- Copy this part & change the coords (coords are gettable by using /laser_place in-game)
laserData.origin = vector3(382.027832, 322.221130, 105.817719)
laserData.endPoint = vector3(379.938660, 327.467743, 103.373978)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
laserData.origin = vector3(372.946411, 331.775787, 105.911980)
laserData.endPoint = vector3(377.819458, 323.231476, 102.853249)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
end
if store.id == '7' then
-- Copy this part & change the coords (coords are gettable by using /laser_place in-game)
laserData.origin = vector3(1956.639404, 3744.124756, 34.611561)
laserData.endPoint = vector3(1963.346436, 3740.342041, 31.480698)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
end
if store.id == '8' then
-- Copy this part & change the coords (coords are gettable by using /laser_place in-game)
laserData.origin = vector3(1729.372681, 6420.378418, 37.346836)
laserData.endPoint = vector3(1731.373535, 6414.694336, 34.191216)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
end
if store.id == '9' then
-- Copy this part & change the coords (coords are gettable by using /laser_place in-game)
laserData.origin = vector3(-327.2485596, 6074.983887, 33.620575)
laserData.endPoint = vector3(-328.871368, 6080.764648, 30.454775)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
laserData.origin = vector3(-335.295929, 6082.912109, 33.668556)
laserData.endPoint = vector3(-325.848785, 6083.090332, 30.454775)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
end
if store.id == '10' then
-- Copy this part & change the coords (coords are gettable by using /laser_place in-game)
laserData.origin = vector3(1170.083252, 2711.477295, 40.427311)
laserData.endPoint = vector3(1165.409058, 2707.395508, 37.739624)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
end
if store.id == '11' then
-- Copy this part & change the coords (coords are gettable by using /laser_place in-game)
laserData.origin = vector3(1132.803955, -978.392822, 48.668377)
laserData.endPoint = vector3(1140.410034, -982.237915, 45.610729)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
end
if store.id == '12' then
-- Copy this part & change the coords (coords are gettable by using /laser_place in-game)
laserData.origin = vector3(550.675415, 2666.242929, 44.424255)
laserData.endPoint = vector3(546.140137, 2667.952881, 41.207958)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
laserData.origin = vector3(540.059387, 2671.584717, 43.918297)
laserData.endPoint = vector3(542.956604, 2669.959473, 41.277302)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
end
if store.id == '13' then
-- Copy this part & change the coords (coords are gettable by using /laser_place in-game)
laserData.origin = vector3(-2965.844482, 386.657928, 17.280094)
laserData.endPoint = vector3(-2969.038574, 390.719055, 14.043308)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
end
if store.id == '14' then
-- Copy this part & change the coords (coords are gettable by using /laser_place in-game)
laserData.origin = vector3(-3043.643555, 582.149353, 10.148930)
laserData.endPoint = vector3(-3041.101807, 587.358337, 7.062905)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
laserData.origin = vector3(-3040.441406, 594.523926, 10.084435)
laserData.endPoint = vector3(-3041.001953, 589.052856, 6.908932)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
end
if store.id == '15' then
-- Copy this part & change the coords (coords are gettable by using /laser_place in-game)
laserData.origin = vector3(1702.901123, 4934.613770, 44.348476)
laserData.endPoint = vector3(1704.439575, 4927.303711, 41.063656)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
laserData.origin = vector3(1701.225098, 4918.948730, 44.348309)
laserData.endPoint = vector3(1699.284668, 4925.133789, 41.063656)
lasers[#lasers+1] = KQLasers:CreateLaser(store.name..#lasers+1, laserData)
end
CreateThread(function()
while IsRobbing do Wait(500) end
for k, laser in pairs(lasers) do
laser.Delete()
lasers[k] = nil
end
end)
end
AddEventHandler('onResourceStop', function(resource)
if resource == GetCurrentResourceName() then
for k, laser in pairs(lasers) do
laser.Delete()
lasers[k] = nil
end
end
end)
--[[
BY RX Scripts Š rxscripts.xyz
--]]
-- Custom can buy check function u can integrate custom checks
---@param playerId number Id/Source of the player
---@param store table Store object
---@return boolean, string?
function CanBuyStore(playerId, store)
return true
-- return false, 'You cannot buy this store because of..'
end
Last updated