Tebex [9.99€ incl. VAT] - 100% is encrypted
Tebex [19.99€ incl. VAT] - about 5% is encrypted
Description
- Create as many Storages as you want
- Create as many Locations as you want
- Set label, price, weight, slots and image for every storage
- Set a Pedmodel or a Marker
- Set your own TextUI instead of the default HelpText
- Set the time between payments (default: 7 days)
- Set the minimum amount that remains on the Bankaccount of the Player if he can’t pay anymore
- The Storage will be deactivated if the Player can’t pay until he can pay again (Items are still inside the storage)
- Support for Chezza Inventory and ox_inventory
- You can implement your own inventory if you want and know how to do that. (integrations folder)
Config
Open Config
Config = {}
----------------------------------------------------------------
Config.Locale = 'en'
Config.Debug = false
Config.VersionChecker = true
----------------------------------------------------------------
-- !!! This function is clientside AND serverside !!!
Config.Notification = function(source, message, typ)
if IsDuplicityVersion() then -- serverside
MSK.Notification(source, 'MSK Storage', message, typ, 5000)
else -- clientside
MSK.Notification('MSK Storage', message, typ, 5000)
end
end
----------------------------------------------------------------
Config.Hotkey = 38 -- default: 38 = E // Change the Key in translation.lua too
Config.npcVoice = {
enable = true, -- The NPC will say something to you
inRange = 5.0,
outRange = 5.0
}
Config.PayCron = 7 -- in days // After X days the amount will be removed from player
Config.MinBudget = 10000 -- Money that remains on the Bankaccount if Player can't pay
-- Configured Societies will get a percentage of the storage price
Config.Society = {
enable = false, -- Set true to activate this Feature // esx_addonaccount will be needed
societies = {
-- Example: ['society_jobname'] = percent // 0.01 is 1% // 0.1 is 10% // 1.0 is 100%
['society_police'] = 0.2,
}
}
----------------------------------------------------------------
-- Set to 'chezza_v3', 'chezza_v4', 'ox_inventory' or 'custom'
-- If set to 'custom' then go to integration folder and add your inventory
Config.Inventory = 'chezza_v3'
----------------------------------------------------------------
Config.defaultTextUI = true -- Set false if you want to use a custom textui
Config.openTextUI = function(coloredText, uncoloredText)
exports['okokTextUI']:Open(uncoloredText, 'darkblue', 'left')
end
Config.closeTextUI = function()
exports['okokTextUI']:Close()
end
----------------------------------------------------------------
Config.Storages = {
-- [id] must be a number, otherwise you'll break the script!
[1] = {
label = {'Warehouse', 'Tier 1'},
price = 5000,
weight = 1000,
slots = 10,
image = 'storage_1.png'
},
[2] = {
label = {'Warehouse', 'Tier 2'},
price = 15000,
weight = 5000,
slots = 15,
image = 'storage_2.png'
},
[3] = {
label = {'Warehouse', 'Tier 3'},
price = 45000,
weight = 10000,
slots = 20,
image = 'storage_3.png'
},
}
Config.Locations = {
-- Marker is only available if pedmodel.enable = false
['l1'] = {
title = 'Warehouse',
subtitle = 'Hafen',
storages = {1, 2, 3},
blip = {enable = true, label = 'Warehouse', id = 473, color = 2, scale = 0.8},
pedmodel = {enable = true, model = 'csb_trafficwarden', distance = 20.0},
marker = {enable = true, distance = 5.0, type = 27, size = {a = 1.0, b = 1.0, c = 1.0}, color = {a = 255, b = 255, c = 255}},
locations = {
vector4(141.82, -3097.87, 5.9, 4.26),
}
},
['l2'] = {
title = 'Warehouse',
subtitle = 'Harmony',
storages = {1, 2},
blip = {enable = true, label = 'Warehouse', id = 473, color = 2, scale = 0.8},
pedmodel = {enable = true, model = 'csb_trafficwarden', distance = 20.0},
marker = {enable = true, distance = 5.0, type = 27, size = {a = 1.0, b = 1.0, c = 1.0}, color = {a = 255, b = 255, c = 255}},
locations = {
vector4(585.81, 2782.25, 43.47, 0.0),
}
},
}
Integrations
Open Integrations Serverside
registerStashes = function()
if Config.Inventory == 'chezza_v3' or Config.Inventory == 'chezza_v4' then return end
while not database do Wait(100) end
if Config.Inventory == 'ox_inventory' then
for identifier, storage in pairs(database) do
local inventory = exports.ox_inventory:GetInventory(storage.uniqueId .. identifier, false)
if not inventory then
registerStash(identifier, storage)
end
end
elseif Config.Inventory == 'custom' then
-- Add your own inventory here
end
end
registerStashes()
registerStash = function(identifier, storage)
if Config.Inventory == 'ox_inventory' then
exports.ox_inventory:RegisterStash(
storage.uniqueId .. identifier,
storage.storageData.label[1] .. ' ' .. storage.storageData.label[2],
storage.storageData.slots,
storage.storageData.weight,
identifier
)
elseif Config.Inventory == 'custom' then
-- Add your own inventory here
end
end
upgradeStash = function(identifier, storage)
if Config.Inventory == 'ox_inventory' then
local id = storage.uniqueId .. identifier
exports.ox_inventory:SetMaxWeight(id, storage.storageData.weight)
exports.ox_inventory:SetSlotCount(id, storage.storageData.slots)
elseif Config.Inventory == 'custom' then
-- Add your own inventory here
end
end
Open Integrations Clientside
openInventoryIntegration = function(storage)
if Config.Inventory == 'chezza_v3' then
TriggerEvent('inventory:open', {
type = "msk_storage",
id = storage.uniqueId .. ESX.PlayerData.identifier,
title = storage.storageData.label[1] .. ' ' .. storage.storageData.label[2],
weight = storage.storageData.weight,
delay = 100,
save = true
})
elseif Config.Inventory == 'chezza_v4' then
TriggerEvent('inventory:openInventory', {
type = "msk_storage",
id = storage.uniqueId .. ESX.PlayerData.identifier,
title = storage.storageData.label[1] .. ' ' .. storage.storageData.label[2],
weight = storage.storageData.weight,
delay = 100,
save = true
})
elseif Config.Inventory == 'ox_inventory' then
exports.ox_inventory:openInventory('stash', storage.uniqueId .. ESX.PlayerData.identifier)
elseif Config.Inventory == 'custom' then
-- Add your own inventory here
end
end
closeInventoryIntegration = function()
if Config.Inventory == 'chezza_v3' then
-- The is no export for that
elseif Config.Inventory == 'chezza_v4' then
exports.inventory:CloseInventory()
elseif Config.Inventory == 'ox_inventory' then
exports.ox_inventory:closeInventory()
elseif Config.Inventory == 'custom' then
-- Add your own inventory here
end
end
Requirements
Nice to know
You can implement your own inventory, see Integrations above.
But unfortunately we can’t give you support for other inventories.
| Code is accessible | No |
| Subscription-based | No |
| Lines (approximately) | ~550 |
| Requirements | See Requirements above |
| Support | Yes |
My other Scripts
Paid
- [ESX] MSK Armor - Multiple Armor Vests
- [ESX] MSK Banking - Advanced Banking with NativeUI
- [ESX] MSK Garage - Garage & Impounds
- [ESX] MSK Handcuffs - Realistic Handcuffs
- [ESX/QBCore] MSK Radio - Channels with password
- [ESX/QBCore] MSK Simcard - Change your phonenumber
- [ESX] MSK WeaponAmmo - Clips, Components & Tints
