mirror of
https://github.com/jimathy/jim-consumables.git
synced 2026-08-18 15:06:03 +01:00
Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e794d9a446 | ||
|
|
541263b156 | ||
|
|
60c42b2506 | ||
|
|
2a4de6fdc1 | ||
|
|
4b015e5efa | ||
|
|
518c5204ae | ||
|
|
12642b7e7b | ||
|
|
c2843eaee2 | ||
|
|
b92e26129f | ||
|
|
129b65deda | ||
|
|
d83d0bbfc4 | ||
|
|
2b6d3f2825 | ||
|
|
cab1ddbe52 | ||
|
|
868f322c8c | ||
|
|
5bbd8a70e8 | ||
|
|
9f5bde25ae | ||
|
|
445ddc82ac | ||
|
|
d9b97dc14c | ||
|
|
c96d1ec277 | ||
|
|
cf3d3c4147 | ||
|
|
4e565268cd | ||
|
|
9e8dcc39f9 | ||
|
|
c2d902c813 | ||
|
|
4d83c8c612 |
17
.github/workflows/notify-discord.yml
vendored
Normal file
17
.github/workflows/notify-discord.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: Discord Commit Notifier
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*' # triggers on all branches
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
notify:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Discord Commits
|
||||||
|
uses: Sniddl/discord-commits@v1.6
|
||||||
|
with:
|
||||||
|
webhook: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
template: "avatar-with-link"
|
||||||
|
include-extras: true
|
||||||
63
README.md
63
README.md
@@ -2,22 +2,15 @@
|
|||||||
Consumables script for QBCore
|
Consumables script for QBCore
|
||||||
|
|
||||||
# What is this?
|
# What is this?
|
||||||
This script is designed as a replacement/override for food and drink consumables in `qb-smallresources`
|
This script WAS designed as a replacement/override for food and drink consumables in `qb-smallresources`
|
||||||
|
|
||||||
It's main purpose was to make it so players did not stand up while sitting with my scripts due to lazy events such as ClearPedTasks in progressbar and dpemotes, this one is designed to cancel the animation you have chosen, not all animations.
|
It's main purpose was to make it so players did not stand up while sitting with my scripts due to lazy events such as ClearPedTasks in progressbar and dpemotes, this one is designed to cancel the animation you have chosen, not ALL animations.
|
||||||
|
|
||||||
It's recommended to set `Config.UseProgBar` to `false` to get this effect.
|
Users requested I readd the progressbar but it ended up being a config option to enable it
|
||||||
|
|
||||||
# THIS DOESN'T USE DPEMOTES OR RPEMOTES
|
Though if your players are cancelling all animations when consuming, it's recommended to set `Config.UseProgBar` to `false` to get this effect.
|
||||||
# YOU **NEED** TO PUT THE EMOTES IN THE BOTTOM OF THE CONFIG.LUA
|
|
||||||
|
|
||||||
## v1.5 Update Information
|
# THIS DOESN'T USE DPEMOTES OR RPEMOTES OR SCULLYS EMOTEMENU
|
||||||
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.
|
|
||||||
|
|
||||||
This will be built into my scripts that use consumables to make it more plug and play
|
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
@@ -51,24 +44,34 @@ ensure [jim]
|
|||||||
## New Items
|
## New Items
|
||||||
To add an item, you only need to add a new item table in the Config.Consumables like this:
|
To add an item, you only need to add a new item table in the Config.Consumables like this:
|
||||||
```lua
|
```lua
|
||||||
["heartstopper"] = {
|
heartstopper = {
|
||||||
emote = "burger", -- Select an emote from below, it has to be in here
|
emote = "burger", -- Select an emote from below, it has to be in here
|
||||||
time = math.random(5000, 6000), -- Amount of time it takes to consume the item
|
time = math.random(5000, 6000), -- Amount of time it takes to consume the item
|
||||||
stress = math.random(1,2), -- Amount of stress relief, can be 0
|
stress = math.random(1,2), -- Amount of stress relief, can be 0
|
||||||
heal = 0, -- Set amount to heal by after consuming
|
heal = 0, -- Set amount to heal by after consuming
|
||||||
armor = 5, -- Amount of armor to add
|
armor = 5, -- Amount of armor to add
|
||||||
type = "food", -- Type: "alcohol" / "drink" / "food"
|
type = "food", -- Type: "alcohol" / "drink" / "food"
|
||||||
returnItem = { -- Item that will be given when the item is used
|
canRun = true, -- If true player can run while using the item, not to it will cancel the event
|
||||||
item = "plastic", -- eg. Plastic bottles can give "plastic"
|
|
||||||
amount = 1,
|
|
||||||
},
|
|
||||||
stats = {
|
stats = {
|
||||||
screen = "rampage", -- The screen effect to be played when after consuming the item
|
screen = "thermal", -- The screen effect to be played when after consuming the item "rampage" "turbo" "focus" "weed" "trevor" "nightvision" "thermal"
|
||||||
effect = "heal", -- The status effect given by the item, "heal" / "stamina"
|
effect = "heal", -- The status effect given by the item, "heal" / "stamina"
|
||||||
|
-- This supports ps-buffs effects "armor" "stress" "swimming" "hacking" "intelligence" "luck" "strength"
|
||||||
time = 10000, -- How long the effect should last (if not added it will default to 10000)
|
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
|
amount = 6, -- 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
|
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
|
thirst = math.random(10, 20), -- The hunger/thirst stats of the item, if not found in the items.lua
|
||||||
|
canOD = true, -- This creates an OD Effect, killing the user if they have too much
|
||||||
|
},
|
||||||
|
--Reward Items Variables
|
||||||
|
-- These can be the only thing in a consumable table and the item will still work
|
||||||
|
amounttogive = 3, -- Used for "RewardItems", tells the script how many to give
|
||||||
|
rewards = {
|
||||||
|
[1] = {
|
||||||
|
item = "plastic", -- prize item name
|
||||||
|
max = 10, -- max amount to give (this is put into math.random(1, max) )
|
||||||
|
rarity = 1, -- the rarity system, 1 being rarest, 4 being most common
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
```
|
```
|
||||||
@@ -86,6 +89,28 @@ The example above uses `rampage` as this is what the effect is named after, you
|
|||||||
"thermal"
|
"thermal"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can also now create "Box" items, when setting type to "pack", it will act as if you user is opening a box
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
- Ammo boxes that give clips
|
||||||
|
- Packets of cigarretes
|
||||||
|
- Crates of beer
|
||||||
|
|
||||||
|
How to set up these:
|
||||||
|
```lua
|
||||||
|
-- Example Box Item
|
||||||
|
["9_box"] = { -- Name of the box item in the shared items
|
||||||
|
emote = "uncuff", -- The emote than should run when "unboxing"
|
||||||
|
canRun = true, -- If true player can run while using the item, not to it will cancel the event
|
||||||
|
time = 3500, -- How long it takes to use the item
|
||||||
|
type = "pack", -- Designate it as a "pack" to the script knows what to do
|
||||||
|
pack = {
|
||||||
|
item = "9_ammo", -- The item to give from the box when complete
|
||||||
|
amount = 20 -- How many of the item to give
|
||||||
|
},
|
||||||
|
},
|
||||||
|
```
|
||||||
|
|
||||||
## PS-Buffs Support
|
## PS-Buffs Support
|
||||||
This scripts can be expanded with ps-buffs (https://github.com/Project-Sloth/ps-buffs)
|
This scripts can be expanded with ps-buffs (https://github.com/Project-Sloth/ps-buffs)
|
||||||
|
|
||||||
|
|||||||
@@ -1,43 +1,64 @@
|
|||||||
local alcoholCount, drugCount, consuming, cancelled = 0, 0, false, false
|
local alcoholCount, drugCount, consuming, cancelled = 0, 0, false, false
|
||||||
Consumables, Emotes = {}, {}
|
Consumables, Emotes = {}, {}
|
||||||
|
|
||||||
local function syncConsumables()
|
|
||||||
Consumables = triggerCallback(getScript()..":server:syncConsumables")
|
|
||||||
Emotes = triggerCallback(getScript()..":server:syncEmotes")
|
|
||||||
debugPrint("^5Debug^7: ^2Retrieved ^6"..countTable(Consumables).." ^2Items and ^6"..countTable(Emotes).." ^2Emotes^7")
|
|
||||||
end
|
|
||||||
|
|
||||||
RegisterNetEvent(getScript()..":client:syncConsumables", function(NewConsumables)
|
|
||||||
if debugMode then
|
|
||||||
for k, v in pairs(NewConsumables) do
|
|
||||||
if not Consumables[k] then
|
|
||||||
print("^5Debug^7: ^2New Item Info added^7: ^6"..k.."^7")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Consumables = NewConsumables
|
|
||||||
end)
|
|
||||||
RegisterNetEvent(getScript()..":client:syncEmotes", function(NewEmotes)
|
|
||||||
if debugMode then
|
|
||||||
for k, v in pairs(NewEmotes) do
|
|
||||||
if not Emotes[k] then
|
|
||||||
print("^5Debug^7: ^2New Emote Info added^7: ^6"..k.."^7")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Emotes = NewEmotes
|
|
||||||
end)
|
|
||||||
|
|
||||||
onPlayerLoaded(function()
|
onPlayerLoaded(function()
|
||||||
syncConsumables()
|
-- Wait until statebag exists, then trigger local handler
|
||||||
|
CreateThread(function()
|
||||||
|
while not GlobalState.jimConsumableItems do Wait(100) end
|
||||||
|
local newConsumables = GlobalState.jimConsumableItems
|
||||||
|
for k in pairsByKeys(newConsumables) do
|
||||||
|
if not Consumables[k] then
|
||||||
|
debugPrint("^5Statebag^7: ^2New ^3Consumable ^2Info synced^7: ^6"..k.."^7")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
while not GlobalState.jimConsumableEmotes do Wait(100) end
|
||||||
|
local newEmotes = GlobalState.jimConsumableEmotes
|
||||||
|
for k in pairsByKeys(newEmotes) do
|
||||||
|
if not Emotes[k] then
|
||||||
|
debugPrint("^5Statebag^7: ^2New ^3Emote ^2Info synced^7: ^6"..k.."^7")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Consumables = newConsumables
|
||||||
|
Emotes = newEmotes
|
||||||
|
debugPrint("^5Statebag^7: ^2Synced ^6"..countTable(Consumables).." ^2Items and ^6"..countTable(Emotes).." ^2Emotes^7")
|
||||||
|
end)
|
||||||
end, true)
|
end, true)
|
||||||
|
|
||||||
|
-- Handlers to recieve global statebag data from the server
|
||||||
|
AddStateBagChangeHandler("jimConsumableItems", nil, function(bagName, key, value, _unused)
|
||||||
|
if type(value) == "table" then
|
||||||
|
local newItemCount = 0
|
||||||
|
for k in pairsByKeys(value) do
|
||||||
|
if not Consumables[k] then
|
||||||
|
newItemCount += 1
|
||||||
|
debugPrint("^5Statebag^7: ^2New ^3Consumable ^2Info synced^7: ^6"..k.."^7")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Consumables = value
|
||||||
|
debugPrint("^5Statebag^7: ^2Synced ^6"..newItemCount.." ^2new Consumables^7")
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
AddStateBagChangeHandler("jimConsumableEmotes", nil, function(bagName, key, value, _unused)
|
||||||
|
if type(value) == "table" then
|
||||||
|
local newEmoteCount = 0
|
||||||
|
for k in pairsByKeys(value) do
|
||||||
|
if not Emotes[k] then
|
||||||
|
newEmoteCount += 1
|
||||||
|
debugPrint("^5Statebag^7: ^2New ^3Emote ^2Info synced^7: ^6"..k.."^7")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Emotes = value
|
||||||
|
debugPrint("^5Statebag^7: ^2Synced ^6"..newEmoteCount.." ^2new Emotes^7")
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
RegisterNetEvent(getScript()..':Consume', function(itemName)
|
RegisterNetEvent(getScript()..':Consume', function(itemName)
|
||||||
|
if not Consumables[itemName] then return end
|
||||||
|
local consumable = Consumables[itemName]
|
||||||
if not hasItem(itemName, 1) then
|
if not hasItem(itemName, 1) then
|
||||||
print("^5Debug^7: ^1Error^7: ^2Item not found in inventory^7, ^2stopping^7..")
|
print("^5Debug^7: ^1Error^7: ^2Item not found in inventory^7, ^2stopping^7..")
|
||||||
end
|
end
|
||||||
local requiredItem = Consumables[itemName].requiredItem or nil
|
local requiredItem = consumable and consumable.requiredItem or nil
|
||||||
|
|
||||||
if requiredItem then
|
if requiredItem then
|
||||||
if not hasItem(requiredItem, 1) then
|
if not hasItem(requiredItem, 1) then
|
||||||
@@ -51,7 +72,7 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
|
|||||||
debugPrint("^5Debug^7: ^3Consume^7: ^2Starting event, locking inventory and grabbing data^7..")
|
debugPrint("^5Debug^7: ^3Consume^7: ^2Starting event, locking inventory and grabbing data^7..")
|
||||||
tempLockInv(true)
|
tempLockInv(true)
|
||||||
local Player = PlayerPedId()
|
local Player = PlayerPedId()
|
||||||
local emote = Emotes[Consumables[itemName].emote] or Emotes["crisps"]
|
local emote = Emotes[consumable.emote] or Emotes["crisps"]
|
||||||
if isAnimal then --- Animal ped adjustments
|
if isAnimal then --- Animal ped adjustments
|
||||||
local presets = {
|
local presets = {
|
||||||
["default"] = {
|
["default"] = {
|
||||||
@@ -99,31 +120,31 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
|
|||||||
Prop = "v_res_tt_bowl",
|
Prop = "v_res_tt_bowl",
|
||||||
PropBone = 64081,
|
PropBone = 64081,
|
||||||
PropPlacement = propPlacement,
|
PropPlacement = propPlacement,
|
||||||
SecondProp = Emotes[Consumables[itemName].emote].AnimationOptions.Prop or nil,
|
SecondProp = Emotes[consumable.emote].AnimationOptions.Prop or nil,
|
||||||
SecondPropBone = Emotes[Consumables[itemName].emote].AnimationOptions.Prop and 64081 or nil,
|
SecondPropBone = Emotes[consumable.emote].AnimationOptions.Prop and 64081 or nil,
|
||||||
SecondPropPlacement = Emotes[Consumables[itemName].emote].AnimationOptions.Prop and propPlacement2 or nil,
|
SecondPropPlacement = Emotes[consumable.emote].AnimationOptions.Prop and propPlacement2 or nil,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
local returnItem = Consumables[itemName].returnItem or nil
|
local returnItem = consumable.returnItem or nil
|
||||||
local animDict, anim = tostring(emote[1]), tostring(emote[2])
|
local animDict, anim = tostring(emote[1]), tostring(emote[2])
|
||||||
local model, model2, bone, bone2, drugeffect, stress
|
local model, model2, bone, bone2, drugeffect, stress
|
||||||
local P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12 = table.unpack({0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) -- Default placement coord cariable
|
local P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12 = table.unpack({0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) -- Default placement coord cariable
|
||||||
local RewardItem = Consumables[itemName].rewards or nil
|
local RewardItem = consumable.rewards or nil
|
||||||
local type = Consumables[itemName].type or ""
|
local type = consumable.type or ""
|
||||||
local pack = Consumables[itemName].pack or nil
|
local pack = consumable.pack or nil
|
||||||
local string = "Using "
|
local string = "Using "
|
||||||
local notifType = ""
|
local canRun = consumable.canRun
|
||||||
local canRun = Consumables[itemName].canRun
|
local stats = consumable.stats
|
||||||
|
|
||||||
local time, stress, heal, armor, stats = GenerateRandomValues({
|
local time, stress, heal, armor, needStats = GenerateRandomValues({
|
||||||
time = Consumables[itemName].time or { 5000, 6000 },
|
time = consumable.time or { 5000, 6000 },
|
||||||
stress = Consumables[itemName].stress or 0,
|
stress = consumable.stress or 0,
|
||||||
heal = Consumables[itemName].heal or 0,
|
heal = consumable.heal or 0,
|
||||||
armor = Consumables[itemName].armor or 0,
|
armor = consumable.armor or 0,
|
||||||
hunger = Consumables[itemName].stats and Consumables[itemName].stats.hunger or 0,
|
hunger = consumable.stats and consumable.stats.hunger or 0,
|
||||||
thirst = Consumables[itemName].stats and Consumables[itemName].stats.thirst or 0,
|
thirst = consumable.stats and consumable.stats.thirst or 0,
|
||||||
})
|
})
|
||||||
if emote.AnimationOptions.Prop then
|
if emote.AnimationOptions.Prop then
|
||||||
model = emote.AnimationOptions.Prop
|
model = emote.AnimationOptions.Prop
|
||||||
@@ -135,27 +156,23 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
|
|||||||
P7, P8, P9, P10, P11, P12 = table.unpack(emote.AnimationOptions.SecondPropPlacement)
|
P7, P8, P9, P10, P11, P12 = table.unpack(emote.AnimationOptions.SecondPropPlacement)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if type == "drink" or type == "alcohol" then
|
if type == "drink" or type == "alcohol" then
|
||||||
string = "Drinking "
|
string = "Drinking "
|
||||||
notifType = "drinking"
|
|
||||||
elseif type == "food" then
|
elseif type == "food" then
|
||||||
string = "Eating "
|
string = "Eating "
|
||||||
notifType = "eating"
|
|
||||||
elseif type == "smoke" then
|
elseif type == "smoke" then
|
||||||
string = "Smoking "
|
string = "Smoking "
|
||||||
notifType = "smoking"
|
|
||||||
elseif type == "pack" then
|
elseif type == "pack" then
|
||||||
string = "Opening "
|
string = "Opening "
|
||||||
notifType = "package"
|
|
||||||
else string = "Using "
|
|
||||||
notifType = "using"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if consuming then
|
if consuming then
|
||||||
cancelled = true
|
cancelled = true
|
||||||
debugPrint("^5Debug^7: ^3Consume^7: ^2Event already started^7, ^1Cancelling^7.")
|
debugPrint("^5Debug^7: ^3Consume^7: ^2Event already started^7, ^1Cancelling^7.")
|
||||||
tempLockInv(false)
|
tempLockInv(false)
|
||||||
if Config.UseProgbar then
|
if Config.UseProgbar then
|
||||||
stopPropgressBar()
|
stopProgressBar()
|
||||||
else
|
else
|
||||||
triggerNotify(nil, "Stopped "..string, "error")
|
triggerNotify(nil, "Stopped "..string, "error")
|
||||||
end
|
end
|
||||||
@@ -191,16 +208,25 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
|
|||||||
debugPrint("^5Debug^7: ^3Consume^7: ^2Player Movement Flag^7 - ^6"..json.encode(MovementType).." ^7")
|
debugPrint("^5Debug^7: ^3Consume^7: ^2Player Movement Flag^7 - ^6"..json.encode(MovementType).." ^7")
|
||||||
if Config.Main.UseProgbar then
|
if Config.Main.UseProgbar then
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
if progressBar({ time = time, label = string..Items[itemName].label.."..", dead = false, cancel = false}) then
|
if progressBar({
|
||||||
|
time = time,
|
||||||
|
label = string..Items[itemName].label.."..",
|
||||||
|
dead = false,
|
||||||
|
disableMovement = false,
|
||||||
|
disableCombat = true,
|
||||||
|
cancel = false
|
||||||
|
}) then
|
||||||
consuming = false
|
consuming = false
|
||||||
else
|
else
|
||||||
|
consuming = false
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
triggerNotify(nil, string..Items[itemName].label.."..", notifType)
|
triggerNotify(nil, string..Items[itemName].label.."..", "success")
|
||||||
end
|
end
|
||||||
|
|
||||||
consuming = true
|
consuming = true
|
||||||
|
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
--Prop Spawning
|
--Prop Spawning
|
||||||
if model then
|
if model then
|
||||||
@@ -212,7 +238,9 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
|
|||||||
if IsModelValid(model2) == 1 then
|
if IsModelValid(model2) == 1 then
|
||||||
attachProp2 = makeProp({ prop = model2, coords = vector4(0.0,0.0,0.0,0.0)}, 1, 1)
|
attachProp2 = makeProp({ prop = model2, coords = vector4(0.0,0.0,0.0,0.0)}, 1, 1)
|
||||||
AttachEntityToEntity(attachProp2, Player, bone2, P7, P8, P9, P10, P11, P12, true, true, false, true, 1, true)
|
AttachEntityToEntity(attachProp2, Player, bone2, P7, P8, P9, P10, P11, P12, true, true, false, true, 1, true)
|
||||||
else print("^5Debug^7: ^3PropSpawn^7: ^2Second prop model isn't valid/found^7.") end
|
else
|
||||||
|
print("^5Debug^7: ^3PropSpawn^7: ^2Second prop model isn't valid/found^7.")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
while consuming do Wait(50) end
|
while consuming do Wait(50) end
|
||||||
if DoesEntityExist(attachProp) then
|
if DoesEntityExist(attachProp) then
|
||||||
@@ -228,19 +256,22 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
while consuming do
|
while consuming do
|
||||||
local drawTable = debugMode and
|
if debugMode then
|
||||||
{ "[BackSpace] Stop Consuming",
|
drawText(nil, {
|
||||||
"Time: "..tostring(time),
|
"Time: "..tostring(time),
|
||||||
"Type: "..(type or ""),
|
"Type: "..(type or ""),
|
||||||
"Hunger: "..(stats.hunger or 0).."%",
|
"Hunger: "..(needStats.hunger or 0).."%",
|
||||||
"Thirst: "..(stats.thirst or 0).."%",
|
"Thirst: "..(needStats.thirst or 0).."%",
|
||||||
"Stress: "..(stress or 0).."%",
|
"Stress: "..(stress or 0).."%",
|
||||||
"Heal: "..(heal or 0).."%",
|
"Heal: "..(heal or 0).."%",
|
||||||
"Armour: "..(armor or 0).."%",
|
"Armour: "..(armor or 0).."%",
|
||||||
} or
|
}, nil, nil)
|
||||||
{ "[BackSpace] Stop Consuming", }
|
end
|
||||||
drawText(nil, drawTable, nil, nil)
|
makeInstructionalButtons({
|
||||||
|
{ keys = { 194 }, text = "Stop Consuming" },
|
||||||
|
})
|
||||||
if time <= 0 then
|
if time <= 0 then
|
||||||
consuming = false
|
consuming = false
|
||||||
end
|
end
|
||||||
@@ -250,7 +281,7 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
|
|||||||
tempLockInv(false)
|
tempLockInv(false)
|
||||||
hideText()
|
hideText()
|
||||||
if Config.Main.UseProgbar then
|
if Config.Main.UseProgbar then
|
||||||
stopPropgressBar()
|
stopProgressBar()
|
||||||
else
|
else
|
||||||
triggerNotify(nil, "Cancelled "..string, "error")
|
triggerNotify(nil, "Cancelled "..string, "error")
|
||||||
end
|
end
|
||||||
@@ -264,6 +295,7 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
|
|||||||
hideText()
|
hideText()
|
||||||
removeItem(itemName, 1)
|
removeItem(itemName, 1)
|
||||||
if returnItem ~= nil then
|
if returnItem ~= nil then
|
||||||
|
debugPrint("returnItem detected")
|
||||||
currentToken = triggerCallback(AuthEvent)
|
currentToken = triggerCallback(AuthEvent)
|
||||||
addItem(returnItem.item, returnItem.amount)
|
addItem(returnItem.item, returnItem.amount)
|
||||||
end
|
end
|
||||||
@@ -271,7 +303,8 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
|
|||||||
-- Reward Item calculations
|
-- Reward Item calculations
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
if RewardItem then
|
if RewardItem then
|
||||||
for i = 1, Consumables[itemName].amounttogive do
|
debugPrint("Reward Item detected")
|
||||||
|
for i = 1, consumable.amounttogive do
|
||||||
local rarity = math.random(1, 4) -- rarity calculation
|
local rarity = math.random(1, 4) -- rarity calculation
|
||||||
while true do
|
while true do
|
||||||
local item = math.random(1, countTable(RewardItem)) -- random item in the list to pick
|
local item = math.random(1, countTable(RewardItem)) -- random item in the list to pick
|
||||||
@@ -287,17 +320,37 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
if stats then
|
if needStats then
|
||||||
if stats.hunger then
|
jsonPrint(needStats)
|
||||||
--stats.hunger = math.random(stats.hunger - 5, stats.hunger + 5)
|
if needStats.hunger > 0 then
|
||||||
TriggerServerEvent(getScript()..":server:addNeed", Core.Functions.GetPlayerData().metadata["hunger"] + stats.hunger, "hunger")
|
local hunger = 0
|
||||||
|
if Core and Core.Functions then
|
||||||
|
hunger = (Core.Functions.GetPlayerData().metadata["hunger"] or 0) + needStats.hunger
|
||||||
|
hunger = hunger > 100 and 100 or hunger
|
||||||
|
|
||||||
|
elseif ESX and ESX.GetPlayerData then
|
||||||
|
hunger = (needStats.hunger / 100) * 1000000
|
||||||
|
hunger = hunger > 1000000 and 1000000 or hunger
|
||||||
end
|
end
|
||||||
if stats.thirst then
|
|
||||||
--stats.thirst = math.random(stats.thirst - 5, stats.thirst + 5)
|
TriggerServerEvent(getScript()..":server:setNeed", "hunger", hunger)
|
||||||
TriggerServerEvent(getScript()..":server:addNeed", Core.Functions.GetPlayerData().metadata["thirst"] + stats.thirst, "thirst")
|
end
|
||||||
|
|
||||||
|
if needStats.thirst > 0 then
|
||||||
|
local thirst = 0
|
||||||
|
if Core and Core.Functions then
|
||||||
|
thirst = (Core.Functions.GetPlayerData().metadata["thirst"] or 0) + needStats.thirst
|
||||||
|
thirst = thirst > 100 and 100 or thirst
|
||||||
|
|
||||||
|
elseif ESX and ESX.GetPlayerData then
|
||||||
|
thirst = (needStats.thirst / 100) * 1000000
|
||||||
|
thirst = thirst > 1000000 and 1000000 or thirst
|
||||||
|
end
|
||||||
|
|
||||||
|
TriggerServerEvent(getScript()..":server:setNeed", "thirst", thirst)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
debugPrint("^5Debug^7: ^2Hunger^7: [^6"..(stats.hunger or 0).."^7] ^2Thrist^7: [^6"..(stats.thirst or 0).."^7]" )
|
debugPrint("^5Debug^7: ^2Hunger^7: [^6"..(needStats.hunger or 0).."^7] ^2Thrist^7: [^6"..(needStats.thirst or 0).."^7]" )
|
||||||
if stress and stress ~= 0 then
|
if stress and stress ~= 0 then
|
||||||
debugPrint("^5Debug^7: ^3Consume^7: ^2Relieving ^6"..stress.." ^2stress^7.")
|
debugPrint("^5Debug^7: ^3Consume^7: ^2Relieving ^6"..stress.." ^2stress^7.")
|
||||||
TriggerServerEvent('hud:server:RelieveStress', stress)
|
TriggerServerEvent('hud:server:RelieveStress', stress)
|
||||||
@@ -317,7 +370,9 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
|
|||||||
TriggerEvent("evidence:client:SetStatus", "alcohol", 200)
|
TriggerEvent("evidence:client:SetStatus", "alcohol", 200)
|
||||||
elseif alcoholCount >= 4 then
|
elseif alcoholCount >= 4 then
|
||||||
TriggerEvent("evidence:client:SetStatus", "heavyalcohol", 200)
|
TriggerEvent("evidence:client:SetStatus", "heavyalcohol", 200)
|
||||||
CreateThread(function() AlienEffect() end) -- Used as overdosing/too drunk effect
|
CreateThread(function()
|
||||||
|
AlienEffect()
|
||||||
|
end) -- Used as overdosing/too drunk effect
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if pack then
|
if pack then
|
||||||
@@ -326,26 +381,20 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
|
|||||||
end
|
end
|
||||||
if stats then
|
if stats then
|
||||||
if stats.screen then -- Screen effect activation
|
if stats.screen then -- Screen effect activation
|
||||||
if stats.screen == "turbo" then
|
debugPrint(stats.screen)
|
||||||
CreateThread(function() TurboEffect() end)
|
local statFunctions = {
|
||||||
end
|
["turbo"] = TurboEffect,
|
||||||
if stats.screen == "focus" then
|
["focus"] = FocusEffect,
|
||||||
CreateThread(function() FocusEffect() end)
|
["rampage"] = RampageEffect,
|
||||||
end
|
["weed"] = WeedEffect,
|
||||||
if stats.screen == "rampage" then
|
["trevor"] = TrevorEffect,
|
||||||
CreateThread(function() RampageEffect() end)
|
["nightvision"] = NightVisionEffect,
|
||||||
end
|
["thermal"] = ThermalEffect,
|
||||||
if stats.screen == "weed" then
|
}
|
||||||
CreateThread(function() WeedEffect() end)
|
if statFunctions[stats.screen] then
|
||||||
end
|
CreateThread(function()
|
||||||
if stats.screen == "trevor" then
|
statFunctions[stats.screen]()
|
||||||
CreateThread(function() TrevorEffect() end)
|
end)
|
||||||
end
|
|
||||||
if stats.screen == "nightvision" then
|
|
||||||
CreateThread(function() NightVisionEffect() end)
|
|
||||||
end
|
|
||||||
if stats.screen == "thermal" then
|
|
||||||
CreateThread(function() ThermalEffect() end)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if stats.canOD then
|
if stats.canOD then
|
||||||
@@ -359,7 +408,9 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if stats.effect == "heal" then
|
if stats.effect then
|
||||||
|
local effectTable = {
|
||||||
|
["heal"] = function(stats)
|
||||||
if isStarted("ps-buffs") then
|
if isStarted("ps-buffs") then
|
||||||
debugPrint("^5Debug^7: ^3Consume^7: ^4PS^7-^4Buffs ^2found^7, ^2hooking in to get buffs and applying ^6Health Buff ^2for ^6"..stats.time.."^7ms")
|
debugPrint("^5Debug^7: ^3Consume^7: ^4PS^7-^4Buffs ^2found^7, ^2hooking in to get buffs and applying ^6Health Buff ^2for ^6"..stats.time.."^7ms")
|
||||||
exports["ps-buffs"]:AddHealthBuff((tonumber(stats.time) or 10000), (stats.amount or 6))
|
exports["ps-buffs"]:AddHealthBuff((tonumber(stats.time) or 10000), (stats.amount or 6))
|
||||||
@@ -368,24 +419,61 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
|
|||||||
HealEffect({(tonumber(stats.time) or 10000), (stats.amount or 6)})
|
HealEffect({(tonumber(stats.time) or 10000), (stats.amount or 6)})
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
if stats.effect == "stamina" then
|
["stamina"] = function(stats)
|
||||||
if isStarted("ps-buffs") then
|
if isStarted("ps-buffs") then
|
||||||
debugPrint("^5Debug^7: ^3Consume^7: ^4PS^7-^4Buffs ^2found^7, ^2hooking in to get buffs and applying ^6Stamina Buff ^2for ^6"..stats.time.."^7ms")
|
debugPrint("^5Debug^7: ^3Consume^7: ^4PS^7-^4Buffs ^2found^7, ^2hooking in to get buffs and applying ^6Stamina Buff ^2for ^6"..stats.time.."^7ms")
|
||||||
exports["ps-buffs"]:StaminaBuffEffect((tonumber(stats.time) or 10000), (stats.amount or 6))
|
exports["ps-buffs"]:StaminaBuffEffect((tonumber(stats.time) or 10000), (stats.amount or 6))
|
||||||
else CreateThread(function() StaminaEffect({(tonumber(stats.time) or 10000), (stats.amount or 6)}) end) end
|
else
|
||||||
|
CreateThread(function()
|
||||||
|
StaminaEffect({(tonumber(stats.time) or 10000), (stats.amount or 6)})
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
end,
|
||||||
|
["armor"] = function(stats)
|
||||||
if isStarted("ps-buffs") then --PS-BUFFS ONLY
|
if isStarted("ps-buffs") then --PS-BUFFS ONLY
|
||||||
if stats.effect then debugPrint("^5Debug^7: ^3Consume^7: ^4PS^7-^4Buffs ^2found^7, ^2hooking in to get buffs and applying ^6"..stats.effect.." Buff ^2for ^6"..(stats.time or "nil").."^7ms") end
|
exports["ps-buffs"]:AddArmorBuff((tonumber(stats.time) or 10000), (stats.amount or 6))
|
||||||
if stats.effect == "armor" then exports["ps-buffs"]:AddArmorBuff((tonumber(stats.time) or 10000), (stats.amount or 6)) end
|
end
|
||||||
if stats.effect == "stress" then exports["ps-buffs"]:AddStressBuff((tonumber(stats.time) or 10000), (stats.amount or 6)) end
|
end,
|
||||||
if stats.effect == "swimming" then exports["ps-buffs"]:SwimmingBuffEffect((tonumber(stats.time) or 10000), (stats.amount or 6)) end
|
["stress"] = function(stats)
|
||||||
if stats.effect == "hacking" then exports["ps-buffs"]:AddBuff("hacking", (tonumber(stats.time) or 10000)) end
|
if isStarted("ps-buffs") then --PS-BUFFS ONLY
|
||||||
if stats.effect == "intelligence" then exports["ps-buffs"]:AddBuff("intelligence", (tonumber(stats.time) or 10000)) end
|
exports["ps-buffs"]:AddStressBuff((tonumber(stats.time) or 10000), (stats.amount or 6))
|
||||||
if stats.effect == "luck" then exports["ps-buffs"]:AddBuff("luck", (tonumber(stats.time) or 10000)) end
|
end
|
||||||
if stats.effect == "strength" then exports["ps-buffs"]:AddBuff("strength", (tonumber(stats.time) or 10000)) end
|
end,
|
||||||
|
["swimming"] = function(stats)
|
||||||
|
if isStarted("ps-buffs") then --PS-BUFFS ONLY
|
||||||
|
exports["ps-buffs"]:SwimmingBuffEffect((tonumber(stats.time) or 10000), (stats.amount or 6))
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
["hacking"] = function(stats)
|
||||||
|
if isStarted("ps-buffs") then --PS-BUFFS ONLY
|
||||||
|
exports["ps-buffs"]:AddBuff("hacking", (tonumber(stats.time) or 10000))
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
["intelligence"] = function(stats)
|
||||||
|
if isStarted("ps-buffs") then --PS-BUFFS ONLY
|
||||||
|
exports["ps-buffs"]:AddBuff("intelligence", (tonumber(stats.time) or 10000))
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
["luck"] = function(stats)
|
||||||
|
if isStarted("ps-buffs") then --PS-BUFFS ONLY
|
||||||
|
exports["ps-buffs"]:AddBuff("luck", (tonumber(stats.time) or 10000))
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
["strength"] = function(stats)
|
||||||
|
if isStarted("ps-buffs") then --PS-BUFFS ONLY
|
||||||
|
exports["ps-buffs"]:AddBuff("strength", (tonumber(stats.time) or 10000))
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
if effectTable[stats.effect] then
|
||||||
|
effectTable[stats.effect](stats)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if stats.widepupils then
|
||||||
|
TriggerEvent("evidence:client:SetStatus", "widepupils", 200)
|
||||||
end
|
end
|
||||||
if stats.widepupils then TriggerEvent("evidence:client:SetStatus", "widepupils", 200) end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
cancelled = false
|
cancelled = false
|
||||||
@@ -397,13 +485,25 @@ end)
|
|||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
while true do
|
while true do
|
||||||
Wait(10)
|
Wait(10)
|
||||||
if alcoholCount > 0 then Wait(1000 * 60 * 15) alcoholCount -= 1 else Wait(1000) end
|
if alcoholCount > 0 then
|
||||||
if drugCount > 0 then Wait(1000 * 60 * 15) drugCount -= 1 else Wait(1000) end
|
Wait(1000 * 60 * 15)
|
||||||
|
alcoholCount -= 1
|
||||||
|
else
|
||||||
|
Wait(1000)
|
||||||
|
end
|
||||||
|
if drugCount > 0 then
|
||||||
|
Wait(1000 * 60 * 15)
|
||||||
|
drugCount -= 1
|
||||||
|
else
|
||||||
|
Wait(1000)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
onResourceStop(function()
|
onResourceStop(function()
|
||||||
|
|
||||||
lockInv(false)
|
lockInv(false)
|
||||||
|
|
||||||
StopEffects()
|
StopEffects()
|
||||||
|
|
||||||
end, true)
|
end, true)
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
Config = {
|
Config = {
|
||||||
System = {
|
System = {
|
||||||
Debug = true,
|
Debug = false,
|
||||||
EventDebug = false,
|
EventDebug = false,
|
||||||
|
|
||||||
Menu = "qb", -- "qb", "ox"
|
Menu = "qb", -- "qb", "ox"
|
||||||
@@ -10,7 +10,7 @@ Config = {
|
|||||||
|
|
||||||
},
|
},
|
||||||
Main = {
|
Main = {
|
||||||
UseProgbar = false, -- Disabled this, progress bars stop all anims when complete.
|
UseProgbar = false, -- Recommended to disable this, progress bars stop ALL anims when complete.
|
||||||
-- This is intended to create a progressbar to show consuming but it was usually forces animations to end weirdly
|
-- This is intended to create a progressbar to show consuming but it was usually forces animations to end weirdly
|
||||||
},
|
},
|
||||||
Crafting = {
|
Crafting = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name "Jim-Consumables"
|
name "Jim-Consumables"
|
||||||
author "Jimathy"
|
author "Jimathy"
|
||||||
version "2.0"
|
version "2.0.05"
|
||||||
description "Consumables Script"
|
description "Consumables Script"
|
||||||
fx_version "cerulean"
|
fx_version "cerulean"
|
||||||
game "gta5"
|
game "gta5"
|
||||||
@@ -14,15 +14,7 @@ shared_scripts {
|
|||||||
'shared/consumables.lua',
|
'shared/consumables.lua',
|
||||||
'shared/shared.lua',
|
'shared/shared.lua',
|
||||||
|
|
||||||
-- Required core scripts
|
--Jim Bridge - https://github.com/jimathy/jim_bridge
|
||||||
'@ox_lib/init.lua',
|
|
||||||
'@ox_core/lib/init.lua',
|
|
||||||
|
|
||||||
'@es_extended/imports.lua',
|
|
||||||
|
|
||||||
'@qbx_core/modules/playerdata.lua',
|
|
||||||
|
|
||||||
--Jim Bridge
|
|
||||||
'@jim_bridge/starter.lua',
|
'@jim_bridge/starter.lua',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,74 +1,65 @@
|
|||||||
local Consumables = Config.Consumables
|
local Consumables = Config.Consumables
|
||||||
local Emotes = Config.Emotes
|
local Emotes = Config.Emotes
|
||||||
|
|
||||||
|
onResourceStart(function()
|
||||||
for k, v in pairs(Config.Consumables) do
|
for k, v in pairs(Config.Consumables) do
|
||||||
createUseableItem(k, function(source, item) TriggerClientEvent(getScript()..':Consume', source, item.name) end)
|
createUseableItem(k, function(source, item) TriggerClientEvent(getScript()..':Consume', source, item.name) end)
|
||||||
if not Items[k] then print("^1Debug^7: ^2Item check ^7- '^1"..k.."^7' ^2not found in the shared lua^7") end
|
if not Items[k] then print("^1Debug^7: ^2Item check ^7- '^1"..k.."^7' ^2not found in the shared lua^7") end
|
||||||
if not Config.Emotes[v.emote] then print("^1Debug^7: ^2Emote check ^7- '^1"..k.."^7' ^2requested emote ^7'^6"..v.emote.."^7' - ^2not found in config^7.^2lua^7") end
|
if not Config.Emotes[v.emote] then print("^1Debug^7: ^2Emote check ^7- '^1"..k.."^7' ^2requested emote ^7'^6"..v.emote.."^7' - ^2not found in config^7.^2lua^7") end
|
||||||
end
|
end
|
||||||
|
|
||||||
RegisterNetEvent(getScript()..':server:addNeed', function(amount, type)
|
|
||||||
local Player = Core.Functions.GetPlayer(source) if not Player then return end
|
|
||||||
if type == "thirst" then
|
|
||||||
Player.Functions.SetMetaData('thirst', amount)
|
|
||||||
TriggerClientEvent('hud:client:UpdateNeeds', source, Player.PlayerData.metadata.hunger, amount)
|
|
||||||
elseif type == "hunger" then
|
|
||||||
Player.Functions.SetMetaData('hunger', amount)
|
|
||||||
TriggerClientEvent('hud:client:UpdateNeeds', source, amount, Player.PlayerData.metadata.thirst)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
--Export Import System--
|
--Export Import System--
|
||||||
createCallback(getScript()..':server:syncConsumables', function(source) return Consumables end)
|
GlobalState.jimConsumableItems = Consumables
|
||||||
createCallback(getScript()..':server:syncEmotes', function(source) return Emotes end)
|
GlobalState.jimConsumableEmotes = Emotes
|
||||||
|
end, true)
|
||||||
|
|
||||||
|
onResourceStop(function()
|
||||||
|
GlobalState.jimConsumableItems = Consumables
|
||||||
|
GlobalState.jimConsumableEmotes = Emotes
|
||||||
|
end)
|
||||||
|
|
||||||
local syncScheduled = false
|
local syncScheduled = false
|
||||||
function syncConsumables()
|
function syncConsumables()
|
||||||
if Config.System.Debug then print("^5Debug^7: ^2Sending ^6"..countTable(Consumables).." ^3Consumables ^2to all clients^7") end
|
debugPrint("^5Statebag^7: ^2Sending ^6"..countTable(Consumables).." ^3Consumables ^2to all clients^7")
|
||||||
TriggerClientEvent(getScript()..":client:syncConsumables", -1, Consumables)
|
GlobalState.jimConsumableItems = Consumables
|
||||||
syncScheduled = false
|
syncScheduled = false
|
||||||
end
|
end
|
||||||
|
|
||||||
local emoteSyncScheduled = false
|
local emoteSyncScheduled = false
|
||||||
function syncEmotes()
|
function syncEmotes()
|
||||||
if Config.System.Debug then print("^5Debug^7: ^2Sending ^6"..countTable(Emotes).." ^3Emotes to all clients^7") end
|
debugPrint("^5Statebag^7: ^2Sending ^6"..countTable(Emotes).." ^3Emotes to all clients^7")
|
||||||
TriggerClientEvent(getScript()..":client:syncEmotes", -1, Emotes)
|
GlobalState.jimConsumableEmotes = Emotes
|
||||||
emoteSyncScheduled = false
|
emoteSyncScheduled = false
|
||||||
end
|
end
|
||||||
|
|
||||||
RegisterNetEvent(getScript()..':server:syncAddItem', function(itemName, data)
|
RegisterNetEvent(getScript()..':server:syncAddItem', function(itemName, data)
|
||||||
if not Consumables[itemName] then
|
if not Consumables[itemName] then
|
||||||
Consumables[itemName] = data
|
Consumables[itemName] = data
|
||||||
createUseableItem(itemName, function(source, item) TriggerClientEvent(getScript()..':Consume', source, itemName) end)
|
--createUseableItem(itemName, function(source, item) TriggerClientEvent(getScript()..':Consume', source, itemName) end)
|
||||||
if Config.System.Debug then print("^5Debug^7: "..GetInvokingResource().." ^2is sending new ^3Item^7: '"..itemName.."'") end
|
debugPrint("^5Debug^7: "..GetInvokingResource().." ^2is sending new ^3Item^7: '"..itemName.."'")
|
||||||
if not syncScheduled then
|
if not syncScheduled then
|
||||||
syncScheduled = true
|
syncScheduled = true
|
||||||
Citizen.SetTimeout(5000, syncConsumables)
|
SetTimeout(5000, syncConsumables)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if Config.System.Debug then print("^1Debug^7: "..GetInvokingResource().." ^2is sending ^1duplicate ^3Item^7: '"..itemName.."'") end
|
debugPrint("^1Debug^7: "..GetInvokingResource().." ^2is sending ^1duplicate ^3Item^7: '"..itemName.."'")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent(getScript()..':server:syncAddEmote', function(emoteName, data)
|
RegisterNetEvent(getScript()..':server:syncAddEmote', function(emoteName, data)
|
||||||
if not Emotes[emoteName] then
|
if not Emotes[emoteName] then
|
||||||
Emotes[emoteName] = data
|
Emotes[emoteName] = data
|
||||||
if Config.System.Debug then print("^5Debug^7: "..GetInvokingResource().." ^2is sending new ^3Emote^7: '"..emoteName.."'") end
|
debugPrint("^5Debug^7: "..GetInvokingResource().." ^2is sending new ^3Emote^7: '"..emoteName.."'")
|
||||||
if not emoteSyncScheduled then
|
if not emoteSyncScheduled then
|
||||||
emoteSyncScheduled = true
|
emoteSyncScheduled = true
|
||||||
Citizen.SetTimeout(5000, syncEmotes)
|
SetTimeout(5000, syncEmotes)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if Config.System.Debug then print("^1Debug^7: "..GetInvokingResource().." ^2is sending ^1duplicate ^3Emote^7: '"..emoteName.."'") end
|
debugPrint("^1Debug^7: "..GetInvokingResource().." ^2is sending ^1duplicate ^3Emote^7: '"..emoteName.."'")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent(getScript()..":server:syncConsumables", function()
|
--[[
|
||||||
TriggerClientEvent(getScript()..':client:syncConsumables', -1, Consumables)
|
|
||||||
end)
|
|
||||||
RegisterNetEvent(getScript()..":server:syncEmotes", function()
|
|
||||||
TriggerClientEvent(getScript()..':client:syncEmotes', -1, Emotes)
|
|
||||||
end)
|
|
||||||
|
|
||||||
Core.Commands.Add('consumableCreator', "Create consumables (admin only)", {}, false, function(source)
|
Core.Commands.Add('consumableCreator', "Create consumables (admin only)", {}, false, function(source)
|
||||||
if source > 0 then return TriggerClientEvent(getScript()..":client:consumableCreator", source) end
|
if source > 0 then return TriggerClientEvent(getScript()..":client:consumableCreator", source) end
|
||||||
end, 'admin')
|
end, 'admin')
|
||||||
@@ -76,3 +67,4 @@ end, 'admin')
|
|||||||
Core.Commands.Add('testConsumableEmotes', "Test consumables Emotes (admin only)", {}, false, function(source)
|
Core.Commands.Add('testConsumableEmotes', "Test consumables Emotes (admin only)", {}, false, function(source)
|
||||||
if source > 0 then return TriggerClientEvent(getScript()..":client:testEmotes", source) end
|
if source > 0 then return TriggerClientEvent(getScript()..":client:testEmotes", source) end
|
||||||
end, 'admin')
|
end, 'admin')
|
||||||
|
]]
|
||||||
@@ -1,100 +1,31 @@
|
|||||||
Config = Config or {}
|
Config = Config or {}
|
||||||
|
|
||||||
Config.Consumables = {
|
Config.Consumables = {
|
||||||
redwood_cigarette = { emote = "smoke2", canRun = false, time = 11000, stress = math.random(10, 15), heal = 0, armor = 0, type = "smoke", requiredItem = "lighter", stats = { effect = "stress", time = 5000, amount = math.random(10, 15), canOD = false } },
|
|
||||||
debonaire_cigarette = { emote = "smoke2", canRun = false, time = 11000, stress = math.random(10, 15), heal = 0, armor = 0, type = "smoke", requiredItem = "lighter", stats = { effect = "stress", time = 5000, amount = math.random(10, 15), canOD = false } },
|
|
||||||
|
|
||||||
estancia_cigar = { emote = "smokecigar", canRun = false, time = 11000, stress = math.random(10, 15), heal = 0, armor = 0, type = "smoke", requiredItem = "lighter", stats = { effect = "stress", time = 5000, amount = math.random(10, 15), canOD = false } },
|
--Effects can be applied here, like stamina on coffee for example
|
||||||
|
|
||||||
olivaseriev = { emote = "smokecigar", canRun = false, time = 11000, stress = math.random(10, 15), heal = 0, armor = 0, type = "smoke", requiredItem = "lighter", stats = { effect = "stress", time = 5000, amount = math.random(10, 15), canOD = false } },
|
|
||||||
montecristo = { emote = "smokecigar", canRun = false, time = 11000, stress = math.random(10, 15), heal = 0, armor = 0, type = "smoke", requiredItem = "lighter", stats = { effect = "stress", time = 5000, amount = math.random(10, 15), canOD = false } },
|
|
||||||
partagas = { emote = "smokecigar", canRun = false, time = 11000, stress = math.random(10, 15), heal = 0, armor = 0, type = "smoke", requiredItem = "lighter", stats = { effect = "stress", time = 5000, amount = math.random(10, 15), canOD = false } },
|
|
||||||
hoyodemonterrey = { emote = "smokecigar", canRun = false, time = 11000, stress = math.random(10, 15), heal = 0, armor = 0, type = "smoke", requiredItem = "lighter", stats = { effect = "stress", time = 5000, amount = math.random(10, 15), canOD = false } },
|
|
||||||
|
|
||||||
arturofuente = { emote = "smokecigar", canRun = false, time = 11000, stress = 0, heal = 10, armor = 10, type = "smoke", requiredItem = "lighter", stats = { effect = "stress", time = 5000, amount = 0, canOD = false } },
|
|
||||||
cohiba = { emote = "smokecigar", canRun = false, time = 11000, stress = 0, heal = 0, armor = 10, type = "smoke", requiredItem = "lighter", stats = { effect = "stress", time = 5000, amount = 0, canOD = false } },
|
|
||||||
romeoyjulieta = { emote = "smokecigar", canRun = false, time = 11000, stress = 0, heal = 10, armor = 0, type = "smoke", requiredItem = "lighter", stats = { effect = "stress", time = 5000, amount = 0, canOD = false } },
|
|
||||||
|
|
||||||
dusche = { emote = "beer", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "alcohol", stats = { effect = "stress", time = 5000, amount = 2, thirst = math.random(10,20), canOD = true }},
|
|
||||||
vodka = { emote = "vodkab", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "alcohol", stats = { effect = "stress", time = 5000, amount = 2, thirst = math.random(10,20), canOD = true }},
|
vodka = { emote = "vodkab", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "alcohol", stats = { effect = "stress", time = 5000, amount = 2, thirst = math.random(10,20), canOD = true }},
|
||||||
cherenkov1 = { emote = "cherenkov1", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "alcohol", stats = { effect = "stress", time = 5000, amount = 2, thirst = math.random(10,20), canOD = true }},
|
|
||||||
cherenkov2 = { emote = "cherenkov2", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "alcohol", stats = { effect = "stress", time = 5000, amount = 2, thirst = math.random(10,20), canOD = true }},
|
|
||||||
cherenkov3 = { emote = "cherenkov3", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "alcohol", stats = { effect = "stress", time = 5000, amount = 2, thirst = math.random(10,20), canOD = true }},
|
|
||||||
cherenkov4 = { emote = "cherenkov4", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "alcohol", stats = { effect = "stress", time = 5000, amount = 2, thirst = math.random(10,20), canOD = true }},
|
|
||||||
bleuterdchampagne = { emote = "bleuturd", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "alcohol", stats = { effect = "stress", time = 5000, amount = 2, thirst = math.random(10,20), canOD = true }},
|
|
||||||
bourgeoixcognac = { emote = "bourgeoix", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "alcohol", stats = { effect = "stress", time = 5000, amount = 2, thirst = math.random(10,20), canOD = true }},
|
|
||||||
cardiaquecognac = { emote = "cardiaque", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "alcohol", stats = { effect = "stress", time = 5000, amount = 2, thirst = math.random(10,20), canOD = true }},
|
|
||||||
red_wine = { emote = "wine", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "alcohol", stats = { effect = "stress", time = 5000, amount = 2, thirst = math.random(10,20), canOD = true }},
|
|
||||||
white_wine = { emote = "wine", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "alcohol", stats = { effect = "stress", time = 5000, amount = 2, thirst = math.random(10,20), canOD = true }},
|
|
||||||
raggaerum = { emote = "raggae", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "alcohol", stats = { effect = "stress", time = 5000, amount = 2, thirst = math.random(10,20), canOD = true }},
|
|
||||||
beer = { emote = "beer", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "alcohol", stats = { thirst = math.random(10,20), canOD = true }},
|
beer = { emote = "beer", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "alcohol", stats = { thirst = math.random(10,20), canOD = true }},
|
||||||
whiskey = { emote = "whiskey", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "alcohol", stats = { thirst = math.random(10,20), canOD = true }},
|
whiskey = { emote = "whiskey", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "alcohol", stats = { thirst = math.random(10,20), canOD = true }},
|
||||||
godfather = { emote = "whiskey", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "alcohol", stats = { thirst = math.random(10,20), canOD = true }},
|
|
||||||
godmother = { emote = "whiskey", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "alcohol", stats = { thirst = math.random(10,20), canOD = true }},
|
|
||||||
oldfashion = { emote = "whiskey", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "alcohol", stats = { thirst = math.random(10,20), canOD = true }},
|
|
||||||
nightfall_negroni = { emote = "whiskey", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "alcohol", stats = { thirst = math.random(10,20), canOD = true }},
|
|
||||||
|
|
||||||
sandwich = { emote = "sandwich", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = 20, }},
|
sandwich = { emote = "sandwich", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = 20, }},
|
||||||
butter = { emote = "sandwich", canRun = false, time = math.random(5000, 6000), stress = math.random(5, 10), heal = 0, armor = 0, type = "food", stats = { hunger = 20, }},
|
|
||||||
bar_nuts = { emote = "sandwich", canRun = false, time = math.random(5000, 6000), stress = math.random(5, 10), heal = 0, armor = 0, type = "food", stats = { hunger = 20, }},
|
|
||||||
slim_johns = { emote = "sandwich", canRun = false, time = math.random(5000, 6000), stress = math.random(5, 10), heal = 0, armor = 0, type = "food", stats = { hunger = 20, }},
|
|
||||||
twerks_candy = { emote = "egobar", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,15), }},
|
twerks_candy = { emote = "egobar", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,15), }},
|
||||||
snikkel_candy = { emote = "egobar", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,15), }},
|
snikkel_candy = { emote = "egobar", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,15), }},
|
||||||
meteoritebar = { emote = "egobar", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,15), }},
|
|
||||||
zebrabar = { emote = "egobar", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,15), }},
|
|
||||||
egochaser = { emote = "egobar", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,15), }},
|
|
||||||
psandqs = { emote = "egobar", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,15), }},
|
|
||||||
lollipop_blue = { emote = "egobar", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,15), }},
|
|
||||||
lollipop_yellow = { emote = "egobar", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,15), }},
|
|
||||||
lollipop_pink = { emote = "egobar", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,15), }},
|
|
||||||
|
|
||||||
coffee = { emote = "coffee", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "drink", stats = { time = 10000, thirst = math.random(10,15), }},
|
coffee = { emote = "coffee", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "drink", stats = { time = 10000, thirst = math.random(10,15), }},
|
||||||
watermelon_slices = { emote = "orange", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "food", stats = { hunger = math.random(25,35), }, },
|
|
||||||
pineapple_slices = { emote = "orange", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "food", stats = { hunger = math.random(25,35), }, },
|
|
||||||
applejuice = { emote = "drink", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "drink", stats = { thirst = math.random(15,20),}, },
|
|
||||||
orangejuice = { emote = "drink", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "drink", stats = { thirst = math.random(15,20), }, },
|
|
||||||
peachjuice = { emote = "drink", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "drink", stats = { thirst = math.random(15,20), }, },
|
|
||||||
-- prisonslushie = { emote = "drink", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "drink", stats = { thirst = math.random(15,20), }, },
|
|
||||||
water_bottle = { emote = "drink", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "drink", stats = { thirst = 20, }},
|
water_bottle = { emote = "drink", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "drink", stats = { thirst = 20, }},
|
||||||
tosti = { emote = "sandwich", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,15), }},
|
tosti = { emote = "sandwich", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,15), }},
|
||||||
apple = { emote = "apple", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(5,10), }},
|
|
||||||
mkecola = { emote = "ecola", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "drink", stats = { thirst = math.random(15,20), }},
|
|
||||||
mkecolalight = { emote = "ecola", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "drink", stats = { thirst = math.random(15,20), }},
|
|
||||||
mksprunk = { emote = "sprunk", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "drink", stats = { thirst = math.random(15,20), }},
|
|
||||||
mksprunklight = { emote = "sprunk", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "drink", stats = { thirst = math.random(15,20), }},
|
|
||||||
|
|
||||||
munchables_pizza = { emote = "sandwich", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = 20, }},
|
kurkakola = { emote = "ecola", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "drink", stats = { thirst = math.random(10,20), }},
|
||||||
milk = { emote = "milk", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "drink", stats = { thirst = math.random(10,15), }},
|
|
||||||
chocolate_milk = { emote = "milk", canRun = false, time = math.random(5000, 6000), stress = math.random(4, 6), heal = 0, armor = 0, type = "drink", stats = { thirst = math.random(10,16), }},
|
|
||||||
banana = { emote = "banana", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(5,10), }},
|
|
||||||
avacado = { emote = "avacado", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(5,10), }},
|
|
||||||
orange = { emote = "orange", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(5,10), }},
|
|
||||||
carrot = { emote = "carrot", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(5,10), }},
|
|
||||||
|
|
||||||
-- Cigarette Packs
|
--[[----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
redwood_pack = { emote = "uncuff", canRun = true, time = 3500, type = "pack", pack = { item = "redwood_cigarette", amount = 20 }, },
|
-- Items that effect status changes, like bleeding can cause problems as they are all handled in their own scripts
|
||||||
debonaire_pack = { emote = "uncuff", canRun = true, time = 3500, type = "pack", pack = { item = "debonaire_cigarette", amount = 20 }, },
|
-- Testing these but they may be best left handled by default scripts
|
||||||
estancia_pack = { emote = "uncuff", canRun = true, time = 3500, type = "pack", pack = { item = "estancia_cigar", amount = 5 }, },
|
["ifaks"] = { emote = "oxy", time = math.random(5000, 6000), stress = math.random(12, 24), heal = 10, armor = 0, type = "drug", stats = { effect = "heal", amount = 6, widepupils = false, canOD = false } },
|
||||||
|
["bandage"] = { emote = "oxy", time = math.random(5000, 6000), stress = 0, heal = 10, armor = 0, type = "drug", stats = { effect = "heal", amount = 3, widepupils = false, canOD = false } }, },
|
||||||
|
]]
|
||||||
|
|
||||||
-- Cigarette Cartons
|
--Testing effects & armor with small functionality to drugs - This may be another one left to default scripts
|
||||||
redwood_carton = { emote = "uncuff", canRun = true, time = 3500, type = "pack", pack = { item = "redwood_pack", amount = 10 }, },
|
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
debonaire_carton = { emote = "uncuff", canRun = true, time = 3500, type = "pack", pack = { item = "debonaire_pack", amount = 10 }, },
|
|
||||||
estancia_carton = { emote = "uncuff", canRun = true, time = 3500, type = "pack", pack = { item = "estancia_pack", amount = 10 }, },
|
|
||||||
|
|
||||||
foodration = { emote = "egobar", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "food", stats = { hunger = math.random(15,20), }, },
|
|
||||||
mre = { emote = "hotdog", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "food", stats = { hunger = math.random(25,35), }, },
|
|
||||||
|
|
||||||
-- Ammo boxes
|
|
||||||
["9_box"] = { emote = "uncuff", canRun = true, time = 3500, type = "pack", pack = { item = "9_ammo", amount = 20 }, },
|
|
||||||
["12_box"] = { emote = "uncuff", canRun = true, time = 3500, type = "pack", pack = { item = "12_ammo", amount = 10 }, },
|
|
||||||
["380_box"] = { emote = "uncuff", canRun = true, time = 3500, type = "pack", pack = { item = "380_ammo", amount = 20 }, },
|
|
||||||
["38_box"] = { emote = "uncuff", canRun = true, time = 3500, type = "pack", pack = { item = "38_ammo", amount = 20 }, },
|
|
||||||
["308_box"] = { emote = "uncuff", canRun = true, time = 3500, type = "pack", pack = { item = "308_ammo", amount = 20 }, },
|
|
||||||
["357_box"] = { emote = "uncuff", canRun = true, time = 3500, type = "pack", pack = { item = "357_ammo", amount = 20 }, },
|
|
||||||
["45_box"] = { emote = "uncuff", canRun = true, time = 3500, type = "pack", pack = { item = "45_ammo", amount = 20 }, },
|
|
||||||
["545_box"] = { emote = "uncuff", canRun = true, time = 3500, type = "pack", pack = { item = "545_ammo", amount = 20 }, },
|
|
||||||
["556_box"] = { emote = "uncuff", canRun = true, time = 3500, type = "pack", pack = { item = "556_ammo", amount = 20 }, },
|
|
||||||
["762_box"] = { emote = "uncuff", canRun = true, time = 3500, type = "pack", pack = { item = "762_ammo", amount = 20 }, },
|
|
||||||
|
|
||||||
--[[ --Testing effects & armor with small functionality to drugs - This may be another one left to default scripts
|
--[[ --Testing effects & armor with small functionality to drugs - This may be another one left to default scripts
|
||||||
joint = { emote = "smoke3", time = math.random(5000, 6000), stress = math.random(12, 24), heal = 0, armor = 10, type = "drug", stats = { screen = "weed", effect = "armor", widepupils = false, canOD = false } },
|
joint = { emote = "smoke3", time = math.random(5000, 6000), stress = math.random(12, 24), heal = 0, armor = 10, type = "drug", stats = { screen = "weed", effect = "armor", widepupils = false, canOD = false } },
|
||||||
@@ -108,33 +39,48 @@ Config.Consumables = {
|
|||||||
|
|
||||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
--[[Example item
|
--Example item
|
||||||
heartstopper = {
|
-- heartstopper = {
|
||||||
emote = "burger", -- Select an emote from below, it has to be in here
|
-- emote = "burger", -- Select an emote from below, it has to be in here
|
||||||
time = math.random(5000, 6000), -- Amount of time it takes to consume the item
|
-- time = math.random(5000, 6000), -- Amount of time it takes to consume the item
|
||||||
stress = math.random(1,2), -- Amount of stress relief, can be 0
|
-- stress = math.random(1,2), -- Amount of stress relief, can be 0
|
||||||
heal = 0, -- Set amount to heal by after consuming
|
-- heal = 0, -- Set amount to heal by after consuming
|
||||||
armor = 5, -- Amount of armor to add
|
-- armor = 5, -- Amount of armor to add
|
||||||
type = "food", -- Type: "alcohol" / "drink" / "food"
|
-- type = "food", -- Type: "alcohol" / "drink" / "food"
|
||||||
|
-- canRun = true, -- If true player can run while using the item, not to it will cancel the event
|
||||||
|
--
|
||||||
|
-- stats = {
|
||||||
|
-- screen = "thermal", -- The screen effect to be played when after consuming the item "rampage" "turbo" "focus" "weed" "trevor" "nightvision" "thermal"
|
||||||
|
-- effect = "heal", -- The status effect given by the item, "heal" / "stamina"
|
||||||
|
-- -- This supports ps-buffs effects "armor" "stress" "swimming" "hacking" "intelligence" "luck" "strength"
|
||||||
|
-- time = 10000, -- How long the effect should last (if not added it will default to 10000)
|
||||||
|
-- amount = 6, -- 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
|
||||||
|
-- canOD = true, -- This creates an OD Effect, killing the user if they have too much
|
||||||
|
-- },
|
||||||
|
-- --Reward Items Variables
|
||||||
|
-- -- These can be the only thing in a consumable table and the item will still work
|
||||||
|
-- amounttogive = 3, -- Used for "RewardItems", tells the script how many to give
|
||||||
|
-- rewards = {
|
||||||
|
-- [1] = {
|
||||||
|
-- item = "plastic", -- prize item name
|
||||||
|
-- max = 10, -- max amount to give (this is put into math.random(1, max) )
|
||||||
|
-- rarity = 1, -- the rarity system, 1 being rarest, 4 being most common
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
|
||||||
|
-- Example Box Item
|
||||||
|
-- ["9_box"] = { -- Name of the box item in the shared
|
||||||
|
-- emote = "uncuff", -- The emote than should run when "unboxing"
|
||||||
|
-- canRun = true, -- If true player can run while using the item, not to it will cancel the event
|
||||||
|
-- time = 3500, -- How long it takes to use the item
|
||||||
|
-- type = "pack", -- Designate it as a "pack" to the script knows what to do
|
||||||
|
-- pack = {
|
||||||
|
-- item = "9_ammo", -- The item to give from the box when complete
|
||||||
|
-- amount = 20 -- How many of the item to give
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
|
||||||
stats = {
|
|
||||||
screen = "thermal", -- The screen effect to be played when after consuming the item "rampage" "turbo" "focus" "weed" "trevor" "nightvision" "thermal"
|
|
||||||
effect = "heal", -- The status effect given by the item, "heal" / "stamina"
|
|
||||||
-- This supports ps-buffs effects "armor" "stress" "swimming" "hacking" "intelligence" "luck" "strength"
|
|
||||||
time = 10000, -- How long the effect should last (if not added it will default to 10000)
|
|
||||||
amount = 6, -- 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
|
|
||||||
},
|
|
||||||
--Reward Items Variables
|
|
||||||
-- These can be the only thing in a consumable table and the item will still work
|
|
||||||
amounttogive = 3, -- Used for "RewardItems", tells the script how many to give
|
|
||||||
rewards = {
|
|
||||||
[1] = {
|
|
||||||
item = "plastic", -- prize item name
|
|
||||||
max = 10, -- max amount to give (this is put into math.random(1, max) )
|
|
||||||
rarity = 1, -- the rarity system, 1 being rarest, 4 being most common
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},]]
|
|
||||||
}
|
}
|
||||||
@@ -1 +1,6 @@
|
|||||||
2.0
|
2.0.05
|
||||||
|
|
||||||
|
- Fix ESX Hunger events
|
||||||
|
- Fix minor progressBar option issues
|
||||||
|
|
||||||
|
https://github.com/jimathy/jim-consumables
|
||||||
Reference in New Issue
Block a user