📦Ns-Stashes

Create stashes live in server

-----INSTALLATION-----

STEP 1 - Unzip and Add Script To Server

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 below
Config.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 user
    	if Config.Notify == "okok" then
		if not src then	exports['okokNotify']:Alert(title, message, 6000, type)
		else TriggerClientEvent('okokNotify:Alert', src, title, message, 6000, type) end
	elseif Config.Notify == "qb" then
		if not src then	TriggerEvent("QBCore:Notify", message, type)
		else TriggerClientEvent("QBCore:Notify", src, message, type) end
	elseif Config.Notify == "t" then
		if not 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" then
		if not src then TriggerEvent('infinity-notify:sendNotify', message, type)
		else TriggerClientEvent('infinity-notify:sendNotify', src, message, type) end
	elseif 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
	end
end

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 user
	if not src then	--Client trigger
	else -- Server Trigger end
end

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')
end

Config.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
}

STEP 4 - Run SQL

CREATE TABLE IF NOT EXISTS `ns-stashes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` text NOT NULL,
  `data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`data`)),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

Preview Videos

TEBEX

Link to Purchase Escrow ($5.99): https://www.nsscripts.com/package/6092683 Link to Purchase Open Source ($14.99): https://www.nsscripts.com/package/6092749

Discord

Discord Link

Last updated