Unzip the script folder within your server resources folder. Ensure script in server.cfg ... "ensure ns-stashes".
STEP 2 - Script Configuration
When you open the config file you'll see a lines of codes to configure it to your server.
STEP 2.1 - Dependency Configuration
Config.Notify ="qb" -- Add as many as you want belowConfig.Inv ="qb" -- qb or ox or qs (Inventory)Config.Menu ="ox" -- qb or ox (Menu)Config.Lang ="en" -- Language file, you can edit or create your own one.-- STILL Requires Ox_lib!!!
You can change between, ox or qb inventory and menu. Qb-Input is not supported, you require ox_lib for this script. It will not cause any issues when you add it to your server.
Changing notification system
Config.triggerNotify=function(message,type,src) -- function called upon notifying userif Config.Notify =="okok" thenifnot src then exports['okokNotify']:Alert(title, message, 6000, type)elseTriggerClientEvent('okokNotify:Alert', src, title, message, 6000, type) endelseif Config.Notify =="qb" thenifnot src thenTriggerEvent("QBCore:Notify", message, type)elseTriggerClientEvent("QBCore:Notify", src, message, type) endelseif Config.Notify =="t" thenifnot src then exports['t-notify']:Custom({title = title, style =type, message = message, sound =true}) else TriggerClientEvent('t-notify:client:Custom', src, { style = type, duration = 6000, title = title, message = message, sound = true, custom = true}) end
elseif Config.Notify =="infinity" thenifnot src thenTriggerEvent('infinity-notify:sendNotify', message, type)elseTriggerClientEvent('infinity-notify:sendNotify', src, message, type) endelseif Config.Notify =="rr" then if not src then exports.rr_uilib:Notify({msg = message, type = type, style = "dark", duration = 6000, position = "top-right", })
else TriggerClientEvent("rr_uilib:Notify", src, {msg = message, type = type, style = "dark", duration = 6000, position = "top-right", }) end
endend
We have already added the common notification systems for you. If you do not use any of the above, simply delete the If-Else statements, and add your own triggers, one for client and the other for server...
Config.triggerNotify=function(message,type,src) -- function called upon notifying userifnot src then--Client triggerelse-- Server Trigger endend
Changing UI
Many servers use different show and hide UI's. On default we have set it to qb-core. You can also use many others, such as ox.
Understanding that you may not want the UI to show [E] Open Stash, we have added values passed by parameter, stashName(String) and sharedStash (Boolean). You may use, if you want.
Config.ShowUI=function(stashName,sharedStash) -- This function is called to display to open the stash in its zone-- stashName: The stash name you have assigned to it, you may use if needed.-- sharedStash: True=Shared, False=Personal. You may use if you want. exports['qb-core']:DrawText("<b>[E] Open Stash</b>", 'left')endConfig.HideUI=function() -- This function is called to hide to open the stash, when out of its zone exports['qb-core']:HideText()end
STEP 3 - Adding Webhooks (Optional)
Webooks are optional, a choice of peference. It does not log any items being added or taken from inventory. That is logged by the inventory (QS, QB or OX) you are using. It logs when admins are creating stashes, editing stashes, opening or deleting stashes.
Config.Webhook = { -- Add your discord webooks here... Create ="", -- When a stash is created by ... Delete ="", -- When gov delete stash through viewstashes menu Edit ="", -- When gov edit stash through viewstashes menu Open ="" -- When gov opens stash through viewstashes menu}