fix oddities

This commit is contained in:
Luke committed 2023-06-09 00:11:10 +02:00
1 parent 77666c92fb
commit 14609569d7
1 file changed
+13 -15
+13 -15
View File
@@ -1,19 +1,6 @@
import { Tabs, Tab } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
```lua
local itemNames
ESX.RegisterServerCallback('crafting:itemNames', function(source, cb)
if not itemNames then
itemNames = {}
for item, data in pairs(exports.ox_inventory:Items()) do
itemNames[item] = data.label
end
end
cb(itemNames)
end)
```
## setPlayerInventory
Creates and sets the player's inventory.
@@ -114,6 +101,19 @@ exports.ox_inventory:Items()
The following snippet can be used in crafting resources such as okokCrafting or core_crafting, rather than querying the database.
```lua
local itemNames
ESX.RegisterServerCallback('crafting:itemNames', function(source, cb)
if not itemNames then
itemNames = {}
for item, data in pairs(exports.ox_inventory:Items()) do
itemNames[item] = data.label
end
end
cb(itemNames)
end)
```
## AddItem
Adds an item into the specified inventory.
@@ -713,8 +713,6 @@ For a use case example on this function check out the written [Guide](../../../G
## CreateTemporaryStash
# CreateTemporaryStash
Creates a temporary stash which will be removed after some time.
```lua