mirror of
https://github.com/jimathy/jim-consumables.git
synced 2026-08-16 22:16:02 +01:00
Update README.md
This commit is contained in:
34
README.md
34
README.md
@@ -6,15 +6,29 @@ This script is designed as a replacement/override for food and drink consumables
|
||||
|
||||
It's main purpose was to make it possible to not stand up while sitting due to lazy events such as ClearPedTasks in most scripts, this one is designed to cancel the animation you have chosen, not all animations. This includes progressbar.
|
||||
|
||||
## v1.4 Beta Information
|
||||
I've added a export system that allows scripts to easily add new foods and drinks to be usable and then sync them between players
|
||||
This should work but may have issues.
|
||||
|
||||
But because of the export system being used, Jim-Consumables **NEEDS** to start before any scripts that use it.
|
||||
|
||||
And small example snippet for this imports the item and the emote, then syncs it to players
|
||||
|
||||
```lua
|
||||
local foodTable = {
|
||||
["shotfries"] = { emote = "bsfries", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "food", stats = { hunger = math.random(55,65), }},
|
||||
}
|
||||
local emoteTable = {
|
||||
["bsfries"] = {"mp_player_inteat@burger", "mp_player_int_eat_burger_fp", "Fries", AnimationOptions = { Prop = "prop_food_bs_chips", PropBone = 18905, PropPlacement = {0.09, -0.06, 0.05, 300.0, 150.0}, EmoteMoving = true, EmoteLoop = true, }},
|
||||
}
|
||||
|
||||
for k, v in pairs(emoteTable) do exports["jim-consumables"]:importEmote(k, v) end
|
||||
for k, v in pairs(foodTable) do exports["jim-consumables"]:importConsumable(k, v) end
|
||||
```
|
||||
This will grab the `shotfries` item info and add it to the `Config.Consumables` while the servers running and the same with the built-in emote system
|
||||
|
||||
# Installation
|
||||
|
||||
```
|
||||
Please stop asking to how add a progressbar...PLEASE
|
||||
|
||||
This script was designed to not need one, because of how it cancels all the player animations instantly
|
||||
|
||||
You can manage without a progressbar.
|
||||
```
|
||||
This script is recommended to be ran last/at the bottom of your server.cfg because this is intended to take control of items, if ran too early the original script may override this one.
|
||||
|
||||
It already takes control of default qbcore food and drink, but you would probably want to add more.
|
||||
@@ -28,14 +42,14 @@ To add an item, you only need to add a new item table in the Config.Consumables
|
||||
heal = 0, -- Set amount to heal by after consuming
|
||||
armor = 5, -- Amount of armor to add
|
||||
type = "food", -- Type: "alcohol" / "drink" / "food"
|
||||
returnItem = { -- Item that will be given when the item is used
|
||||
item = "plastic", -- eg. Plastic bottles can give "plastic"
|
||||
returnItem = { -- Item that will be given when the item is used
|
||||
item = "plastic", -- eg. Plastic bottles can give "plastic"
|
||||
amount = 1,
|
||||
},
|
||||
stats = {
|
||||
screen = "rampage", -- The screen effect to be played when after consuming the item
|
||||
effect = "heal", -- The status effect given by the item, "heal" / "stamina"
|
||||
time = 10000, -- How long the effect should last (if not added it will default to 10000 which is 10 seconds)
|
||||
time = 10000, -- How long the effect should last (if not added it will default to 10000)
|
||||
amount = 2, -- How much the value is changed by per second
|
||||
hunger = math.random(10,20), -- The hunger/thirst stats of the item, if not found in the items.lua
|
||||
thirst = math.random(10,20), -- The hunger/thirst stats of the item, if not found in the items.lua
|
||||
|
||||
Reference in New Issue
Block a user