JRS COREالوثائق
مرجع الـ API

metabolism

Hunger and thirst API for JRS Core

Note

جهة الكلاينت

The available status types are Hunger and Thirst. The key is case insensitive.

Value range: Hunger and Thirst go from 0 to 1000.

Tip

Food and drink items are registered automatically from jrs_items (type food / drink). To tune a single item, add it to Config in jrs_metabolism/config.lua.

Change metabolism value#

Adds the given amount to the current value, the result is clamped to 0..1000.

lua
TriggerEvent('jrsmetabolism:changeValue', 'Hunger', 250)

Set metabolism value#

Sets the value directly, clamped to 0..1000.

lua
TriggerEvent('jrsmetabolism:setValue', 'Thirst', 1000)

Get metabolism value#

Returns the current value through the callback, or nil if the key is not a valid status.

lua
TriggerEvent('jrsmetabolism:getValue', 'Hunger', function(value)
    print('hunger value', value)
end)

Toggle the HUD#

Shows or hides the metabolism HUD.

lua
TriggerEvent('jrsmetabolism:setHud', true) -- false to hide
JRS Core · فريمورك RedM مجاني ومفتوح المصدر · من فريق JRS