For developers
Connect your own notifications and hunger/thirst, export and event.
Your own notifications
Set Integrations.Notify = 'custom' and paste your call into Integrations.Custom.Notify. Runs on the client.
| Argument | Type | Description |
|---|---|---|
message | string | The text |
notifyType | string | 'success', 'error' or 'info' |
duration | number or nil | Duration in milliseconds |
ko/integrations.lua
function Integrations.Custom.Notify(message, notifyType, duration)
-- Example, replace with your resource's real API:
exports['your_notify_resource']:yourNotifyExport(message, notifyType, duration)
endDelete the print(...) line, it only reminds you that nothing is set up yet.
Your own hunger and thirst
Set Integrations.Status = 'custom' and return two numbers from 0 to 100 in Integrations.Custom.GetStatus. Runs on the client, about once per second while the inventory is open. nil hides the bar.
ko/integrations.lua
function Integrations.Custom.GetStatus()
-- Example, replace with your resource's real API:
local hunger = exports['your_status_resource']:GetHunger()
local thirst = exports['your_status_resource']:GetThirst()
return hunger, thirst
endExport
| Export | Side | Description |
|---|---|---|
ox_inventory.koClothing | Client | Called by ox_inventory when the clothing item is used. Put it in data/items.lua, do not call it yourself |
Event
| Event | Direction | Description |
|---|---|---|
ox_inventory:ko:notify | Server → client | Shows a message from the locale files. Only keys that exist in ko/locales are accepted, no free text |
lua
TriggerClientEvent('ox_inventory:ko:notify', source, 'throw_failed')Changing texts
All texts are in ko/locales/de.lua and ko/locales/en.lua. Both files have the same keys. A missing key is reported once in the console. ox_inventory's own texts are in locales/*.json.
Security
- Card payment, throwing, bag contents and clothing are checked on the server. The client decides none of it.
- All server callbacks have a limit per player (
KoInv.RateLimit). - The optional playtime query only accepts table and column names made of letters, numbers and
_.
Was this page helpful?
