mirror of
https://github.com/jimathy/jim-consumables.git
synced 2026-08-18 23:16:03 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce137d9089 | ||
|
|
d7a8a20491 | ||
|
|
38d0b04e71 |
@@ -1,6 +1,6 @@
|
|||||||
name "Jim-Consumables"
|
name "Jim-Consumables"
|
||||||
author "Jimathy"
|
author "Jimathy"
|
||||||
version "2.0.08"
|
version "2.0.09"
|
||||||
description "Consumables Script"
|
description "Consumables Script"
|
||||||
fx_version "cerulean"
|
fx_version "cerulean"
|
||||||
game "gta5"
|
game "gta5"
|
||||||
|
|||||||
@@ -120,11 +120,9 @@ RegisterNetEvent(getScript()..":server:finishConsume", function(needTypes)
|
|||||||
removeItem(isConsuming[src].item, 1, src)
|
removeItem(isConsuming[src].item, 1, src)
|
||||||
if isConsuming[src].rewardItem then
|
if isConsuming[src].rewardItem then
|
||||||
debugPrint("^5Debug^7: ^2Giving player ^3"..src.." ^2reward items^7")
|
debugPrint("^5Debug^7: ^2Giving player ^3"..src.." ^2reward items^7")
|
||||||
for i = 1, #isConsuming[src].rewardItem do
|
local item = isConsuming[src].rewardItem
|
||||||
local item = isConsuming[src].rewardItem[i]
|
|
||||||
addItem(item.item, item.amount, nil, src)
|
addItem(item.item, item.amount, nil, src)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
if isConsuming[src].returnItem then
|
if isConsuming[src].returnItem then
|
||||||
debugPrint("^5Debug^7: ^2Giving player ^3"..src.." ^2return item^7")
|
debugPrint("^5Debug^7: ^2Giving player ^3"..src.." ^2return item^7")
|
||||||
for i = 1, #isConsuming[src].returnItem do
|
for i = 1, #isConsuming[src].returnItem do
|
||||||
@@ -133,12 +131,10 @@ RegisterNetEvent(getScript()..":server:finishConsume", function(needTypes)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if isConsuming[src].packItem then
|
if isConsuming[src].packItem then
|
||||||
for i = 1, #isConsuming[src].packItem do
|
|
||||||
debugPrint("^5Debug^7: ^2Giving player ^3"..src.." ^2Pack items^7")
|
debugPrint("^5Debug^7: ^2Giving player ^3"..src.." ^2Pack items^7")
|
||||||
local item = isConsuming[src].packItem[i]
|
local item = isConsuming[src].packItem
|
||||||
addItem(item.item, item.amount, nil, src)
|
addItem(item.item, item.amount, nil, src)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
-- Needs
|
-- Needs
|
||||||
if needTypes.thirst then
|
if needTypes.thirst then
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ function GenerateRandomValues(data)
|
|||||||
transData[k] = v
|
transData[k] = v
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if transData.hunger > 0 then
|
if transData.hunger > 0 then
|
||||||
transData.hunger = transData.hunger > 100 and 100 or transData.hunger
|
transData.hunger = transData.hunger > 100 and 100 or transData.hunger
|
||||||
end
|
end
|
||||||
@@ -26,12 +27,13 @@ function GenerateRandomValues(data)
|
|||||||
if transData.stress > 0 then
|
if transData.stress > 0 then
|
||||||
transData.stress = transData.stress > 100 and 100 or transData.stress
|
transData.stress = transData.stress > 100 and 100 or transData.stress
|
||||||
end
|
end
|
||||||
|
|
||||||
return transData["time"],
|
return transData["time"],
|
||||||
transData["heal"],
|
transData["heal"],
|
||||||
transData["armor"],
|
transData["armor"],
|
||||||
{
|
{
|
||||||
hunger = transData["hunger"],
|
hunger = transData["hunger"] or 0,
|
||||||
thirst = transData["thirst"],
|
thirst = transData["thirst"] or 0,
|
||||||
stress = transData["stress"]
|
stress = transData["stress"] or 0
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
2.0.08
|
2.0.09
|
||||||
|
|
||||||
- Fix issues with stress calculations
|
- Fix possible issue with nil needTypes tables being sent
|
||||||
- Separates "drug control" from canOD boolean
|
- Fix packitems and return items not giving any items
|
||||||
- Adds support for jim_bridge built-in synchronized alcohol/drug effects
|
|
||||||
|
|
||||||
https://github.com/jimathy/jim-consumables/releases/latest
|
https://github.com/jimathy/jim-consumables/releases/latest
|
||||||
Reference in New Issue
Block a user