# FX-Stash&#x20;

#### NEW VORP INVENTORY

vorp\_inventory/server/services/inventoryApiService.lua

**Replace Function**

```lua
local function canContinue(id)
    if not CustomInventoryInfos[id] then
        return false
    end

    if not CustomInventoryInfos[id]:isPermEnabled() then
        return false
    end

    -- if not jobName and not grade then -- best code block for outsider xd
    --     return false
    -- end
    return true
end
```

#### OLD INVENTORY

<mark style="color:green;">**STEP - 1**</mark>

*Add the following codes to the specified .lua file*

#### `vorp_inventory/client/controllers/NUIController.lua`

***Add the code below***

```lua
-- Fixitfy Stash Module
RegisterNetEvent("fx-stash:OpenStashInventory")
AddEventHandler("fx-stash:OpenStashInventory", NUIService.OpenStashInventory)
RegisterNetEvent("fx-stash:ReloadStashInventory")
AddEventHandler("fx-stash:ReloadStashInventory", NUIService.ReloadInventory)
RegisterNUICallback('TakeFromStash', NUIService.NUITakeFromStash)
RegisterNUICallback('MoveToStash', NUIService.NUIMoveToStash)
```

<mark style="color:green;">**STEP - 2**</mark>

*Add the following codes to the specified .lua file*

#### `vorp_inventory/client/services/NUIService.lua`

*Add the code below after line 311*

```lua
------------------------ FİXİTFY ------------------------
NUIService.OpenStashInventory = function(stashname, stashid, capacity)
	fixitfyStash = stashname
	SetNuiFocus(true, true)
	SendNUIMessage({
		action = "display",
		type = "stash",
		title = stashname,
		stashid = stashid,
		capacity = capacity,
		search = Config.InventorySearchable
	})
	InInventory = true
end

NUIService.NUIMoveToStash = function(obj)
	TriggerServerEvent("fx-stash:MoveToStash", json.encode(obj))
end

NUIService.NUITakeFromStash = function(obj)
	TriggerServerEvent("fx-stash:TakeFromStash", json.encode(obj))
end
------------------------------------------------------------
```

```lua
  local fixitfyStash = false    -- ADD TO LINE 10
 -- Find And Replace The Following Function
  NUIService.CloseInventory = function()
    if storemenu then
        storemenu = false
        geninfo = {}
        for _, item in pairs(UserInventory) do
            if item.metadata ~= nil and item.metadata.description ~= nil and
                (item.metadata.orgdescription ~= nil or item.metadata.orgdescription == "") then
                if item.metadata.orgdescription == "" then
                    item.metadata.description = nil
                else
                    item.metadata.description = item.metadata.orgdescription
                end
                item.metadata.orgdescription = nil
            end
        end
    end
    if fixitfyStash then
        TriggerServerEvent('fx-stash:closeStash',fixitfyStash)
        fixitfyStash = false
    end
    if not CanOpen then -- only trigger if somone is inside custom inv
        TriggerServerEvent("vorp_inventory:Server:UnlockCustomInv")
    end
    SetNuiFocus(false, false)
    SendNUIMessage({ action = "hide" })
    InInventory = false
    TriggerEvent("vorp_stables:setClosedInv", false)
    TriggerEvent("syn:closeinv")
end
-- Find And Replace The Following Function
NUIService.CloseInv = function()
    if storemenu then
        storemenu = false
        geninfo = {}
        for _, item in pairs(UserInventory) do
            if item.metadata ~= nil and item.metadata.description ~= nil and
                (item.metadata.orgdescription ~= nil or item.metadata.orgdescription == "") then
                if item.metadata.orgdescription == "" then
                    item.metadata.description = nil
                else
                    item.metadata.description = item.metadata.orgdescription
                end
                item.metadata.orgdescription = nil
            end
        end
    end
    if fixitfyStash then
        TriggerServerEvent('fx-stash:closeStash',fixitfyStash)
        fixitfyStash = false
    end
    if not CanOpen then -- only trigger if somone is inside
        TriggerServerEvent("vorp_inventory:Server:UnlockCustomInv")
    end
    SetNuiFocus(false, false)
    SendNUIMessage({ action = "hide" })
    InInventory = false
    TriggerEvent("vorp_stables:setClosedInv", false)
    TriggerEvent("syn:closeinv")
end
```

<mark style="color:green;">**STEP - 3**</mark>

*Change the below mentioned codes*

**`vorp_inventory/html/js/secondaryInvScript.js`**

* Replace const ActionTakeList

```js
const ActionTakeList = {
  custom: { action: "TakeFromCustom", id: () => customId, customtype: "id" },
  cart: { action: "TakeFromCart", id: () => wagonid, customtype: "wagon" },
  house: { action: "TakeFromHouse", id: () => houseId, customtype: "house" },
  stash: { action: "TakeFromStash", id: () => stashid, customtype: "stash" },
  hideout: {
    action: "TakeFromHideout",
    id: () => hideoutId,
    customtype: "hideout",
  },
  bank: { action: "TakeFromBank", id: () => bankId, customtype: "bank" },
  clan: { action: "TakeFromClan", id: () => clanid, customtype: "clan" },
  steal: { action: "TakeFromsteal", id: () => stealid, customtype: "steal" },
  Container: {
    action: "TakeFromContainer",
    id: () => Containerid,
    customtype: "Container",
  },
  horse: { action: "TakeFromHorse", id: () => horseid, customtype: "horse" },
};
```

**- Replace const ActionMoveList**

```js
const ActionMoveList = {
  custom: { action: "MoveToCustom", id: () => customId, customtype: "id" },
  cart: { action: "MoveToCart", id: () => wagonid, customtype: "wagon" },
  house: { action: "MoveToHouse", id: () => houseId, customtype: "house" },
  stash: { action: "MoveToStash", id: () => stashid, customtype: "stash" },
  hideout: {
    action: "MoveToHideout",
    id: () => hideoutId,
    customtype: "hideout",
  },
  bank: { action: "MoveToBank", id: () => bankId, customtype: "bank" },
  clan: { action: "MoveToClan", id: () => clanid, customtype: "clan" },
  steal: { action: "MoveTosteal", id: () => stealid, customtype: "steal" },
  Container: {
    action: "MoveToContainer",
    id: () => Containerid,
    customtype: "Container",
  },
  horse: { action: "MoveToHorse", id: () => horseid, customtype: "horse" },
};
```

\ <mark style="color:green;">**STEP - 4**</mark>

*Add the following code to the specified file. After line 143*

**`vorp_inventory/html/js/script.js`**

```js
        if (event.data.type == "stash") {
            stashid = event.data.stashid;
            initiateSecondaryInventory(stashid, event.data.title, event.data.capacity)
        }
```

<mark style="color:green;">**STEP - 5**</mark>

Add the following code to the specified file. After line 8

#### `vorp_inventory/html/js/data.js`

```js
  let stashid = 0;
```

Congratulations, you can now create stashes  <img src="/files/oyleiyeJ6gOdNmYjdMnc" alt="" data-size="line">


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fixitfy.gitbook.io/redm-scripts/fx-stash.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
