refactor: Add h1 headers to all pages missing it (#137)

* refactor: Add h1 headers to all pages missing it

* refactor: missed example h3

* change hooks example heading to bold text

---------

Co-authored-by: Luke <[email protected]>
This commit is contained in:
JagandLuke authored and GitHub committed 2023-07-08 11:08:43 +02:00
1 parent 74227cc262
commit 1d2c490b26
95 files changed
+2167 -2289

No files matched your search

+27 -29
View File
@@ -4,6 +4,8 @@ title: ESX
import { Tabs, Tab } from 'nextra-theme-docs';
# ESX
## Compatibility
Ox Inventory is a complete replacement for existing item, inventory, and weapon systems; it is inherently incompatible with ESX and any resources that rely on default behaviour.
@@ -31,7 +33,7 @@ start ox_inventory
- Optionally, type `convertinventory esxproperty` into the server console.
- Restart the server once conversion is complete.
## Optional optimisation
## Optional Optimisation
All item related functions from xPlayer, such as `xPlayer.getInventoryItem`, have been modified for compatibility purposes; however they are considered deprecated.
@@ -40,35 +42,31 @@ The reasoning is fairly simple - there's now additional function references and
You should read through the functions section for further information, but the following should give you a decent idea.
<Tabs items={["ESX", "Ox Inventory"]}>
<Tab>
<Tab>
```lua
if xPlayer.getInventoryItem('acetone').count > 2 and xPlayer.getInventoryItem('antifreeze').count > 4 and xPlayer.getInventoryItem('sudo').count > 9 then
xPlayer.removeInventoryItem("acetone", 3)
xPlayer.removeInventoryItem("antifreeze", 5)
xPlayer.removeInventoryItem("sudo", 10)
end
```
</Tab>
<Tab>
Add the following code somewhere in your resource to cache the exports metatable.
```lua
if xPlayer.getInventoryItem('acetone').count > 2 and xPlayer.getInventoryItem('antifreeze').count > 4 and xPlayer.getInventoryItem('sudo').count > 9 then
xPlayer.removeInventoryItem("acetone", 3)
xPlayer.removeInventoryItem("antifreeze", 5)
xPlayer.removeInventoryItem("sudo", 10)
end
```
```lua
local ox_inventory = exports.ox_inventory
```
</Tab>
<Tab>
You will be able to reference any functions exposed through the export.
Add the following code somewhere in your resource to cache the exports metatable.
```lua
local ox_inventory = exports.ox_inventory
```
You will be able to reference any functions exposed through the export.
```lua
local items = ox_inventory:Search(source, 'count', {'acetone', 'antifreeze', 'sudo'})
if items and items.acetone > 2 and items.antifreeze > 4 and items.sudo > 9 then
ox_inventory:RemoveItem(source, 'acetone', 3)
ox_inventory:RemoveItem(source, 'antifreeze', 5)
ox_inventory:RemoveItem(source, 'sudo', 10)
end
```
</Tab>
```lua
local items = ox_inventory:Search(source, 'count', {'acetone', 'antifreeze', 'sudo'})
if items and items.acetone > 2 and items.antifreeze > 4 and items.sudo > 9 then
ox_inventory:RemoveItem(source, 'acetone', 3)
ox_inventory:RemoveItem(source, 'antifreeze', 5)
ox_inventory:RemoveItem(source, 'sudo', 10)
end
```
</Tab>
</Tabs>
+31 -35
View File
@@ -5,10 +5,10 @@ title: QBCore
import { Callout } from 'nextra/components';
import { Tabs, Tab } from 'nextra-theme-docs';
# QBCore
<Callout type="warning">
QBCore support is experimental and cannot work as a "drag and drop" solution due to many incompatibilities.
QBCore support is experimental and cannot work as a "drag and drop" solution due to many incompatibilities.
</Callout>
## Compatibility
@@ -43,7 +43,7 @@ If you have existing player data, you will need to convert it to a compatible fo
- Start the server and type `convertinventory qb` into the server console.
- Restart the server once conversion is complete.
## Optional optimisation
## Optional Optimisation
All item related functions from Player, such as `Player.Functions.GetItemByName`, have been modified for compatibility purposes; however they are considered deprecated.
@@ -52,38 +52,34 @@ The reasoning is fairly simple - there's now additional function references and
You should read through the functions section for further information, but the following should give you a decent idea.
<Tabs items={["QBCore", "Ox Inventory"]}>
<Tab>
<Tab>
```lua
local acetone = Player.Functions.GetItemByName('acetone')
local antifreeze = Player.Functions.GetItemByName('antifreeze')
local sudo = Player.Functions.GetItemByName('sudo')
if acetone?.amount > 2 and antifreeze?.amount > 4 and sudo?.amount > 9 then
Player.Functions.RemoveItem("acetone", 3)
Player.Functions.RemoveItem("antifreeze", 5)
Player.Functions.RemoveItem("sudo", 10)
end
```
</Tab>
<Tab>
Add the following code somewhere in your resource to cache the exports metatable.
```lua
local acetone = Player.Functions.GetItemByName('acetone')
local antifreeze = Player.Functions.GetItemByName('antifreeze')
local sudo = Player.Functions.GetItemByName('sudo')
if acetone?.amount > 2 and antifreeze?.amount > 4 and sudo?.amount > 9 then
Player.Functions.RemoveItem("acetone", 3)
Player.Functions.RemoveItem("antifreeze", 5)
Player.Functions.RemoveItem("sudo", 10)
end
```
```lua
local ox_inventory = exports.ox_inventory
```
</Tab>
<Tab>
You will be able to reference any functions exposed through the export.
Add the following code somewhere in your resource to cache the exports metatable.
```lua
local ox_inventory = exports.ox_inventory
```
You will be able to reference any functions exposed through the export.
```lua
local items = ox_inventory:Search(source, 'count', {'acetone', 'antifreeze', 'sudo'})
if items and items.acetone > 2 and items.antifreeze > 4 and items.sudo > 9 then
ox_inventory:RemoveItem(source, 'acetone', 3)
ox_inventory:RemoveItem(source, 'antifreeze', 5)
ox_inventory:RemoveItem(source, 'sudo', 10)
end
```
</Tab>
```lua
local items = ox_inventory:Search(source, 'count', {'acetone', 'antifreeze', 'sudo'})
if items and items.acetone > 2 and items.antifreeze > 4 and items.sudo > 9 then
ox_inventory:RemoveItem(source, 'acetone', 3)
ox_inventory:RemoveItem(source, 'antifreeze', 5)
ox_inventory:RemoveItem(source, 'sudo', 10)
end
```
</Tab>
</Tabs>