rewriting on_inventory_interact

This commit is contained in:
Xertis 2026-03-16 00:53:57 +03:00
parent f2684edf1f
commit 8ae35c0a5e
6 changed files with 62 additions and 21 deletions

View file

@ -221,6 +221,18 @@ function on_hud_close(playerid: int)
Called on world close (before saving)
```lua
function on_inventory_interact(invid: int, slot: int, mode: int, action: int)
```
Triggered when a player interacts with inventory slots.
| ACTION / MODE | (0) PRIMARY | (1) SECONDARY |
| ------------- | -------------------------------------------------- | ------------------------------------------------------ |
| (0) PUT | Places all items; if occupied, swaps them. | Places a single item from the cursor into the slot. |
| (1) TAKE | Picks up all items from the slot. | Picks up half of the items from the slot (rounded up). |
| (2) SHARE | Triggers the share event for the inventory layout. | Undefined |
## *events* library
```lua