mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 22:22:46 +00:00
Update Hooks.md
This commit is contained in:
1 parent
1ba636a6e6
commit
debe130fe1
1 file changed
+8
-4
@@ -1,3 +1,7 @@
|
|||||||
|
# Event Hooks
|
||||||
|
|
||||||
|
## registerHook
|
||||||
|
|
||||||
Event hooks allow 3rd party resources to define new behaviour without modifying the inventory code directly.
|
Event hooks allow 3rd party resources to define new behaviour without modifying the inventory code directly.
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
@@ -20,7 +24,7 @@ Return:
|
|||||||
|
|
||||||
- hookId: `number`
|
- hookId: `number`
|
||||||
|
|
||||||
## swapItems
|
### swapItems
|
||||||
|
|
||||||
Triggered when moving any item from one slot to another, or when "giving" an item.
|
Triggered when moving any item from one slot to another, or when "giving" an item.
|
||||||
By returning `false`, you can cancel the action and revert the inventory state.
|
By returning `false`, you can cancel the action and revert the inventory state.
|
||||||
@@ -57,7 +61,7 @@ end, {
|
|||||||
|
|
||||||
Blacklists "water" from being moved into or from gloveboxes and trunks.
|
Blacklists "water" from being moved into or from gloveboxes and trunks.
|
||||||
|
|
||||||
## openInventory
|
### openInventory
|
||||||
|
|
||||||
**Payload:**
|
**Payload:**
|
||||||
|
|
||||||
@@ -85,7 +89,7 @@ end, {
|
|||||||
|
|
||||||
Disables gloveboxes and trunks.
|
Disables gloveboxes and trunks.
|
||||||
|
|
||||||
## createItem
|
### createItem
|
||||||
|
|
||||||
**Payload:**
|
**Payload:**
|
||||||
|
|
||||||
@@ -115,7 +119,7 @@ end, {
|
|||||||
|
|
||||||
Sets the label for "water" to "Mineral Water".
|
Sets the label for "water" to "Mineral Water".
|
||||||
|
|
||||||
## buyItem
|
### buyItem
|
||||||
|
|
||||||
**Payload:**
|
**Payload:**
|
||||||
- source: `number`
|
- source: `number`
|
||||||
|
|||||||
Reference in new issue
Block a user