3 Commits

Author SHA1 Message Date
Jim Shield
e794d9a446 Version Bump
`2.0.04` - `2.0.05`
2025-06-22 16:37:46 +01:00
Jim Shield
541263b156 Fixes related to progressbars 2025-06-22 16:13:18 +01:00
Jim Shield
60c42b2506 Fix hunger being wrong on esx when consuming 2025-06-20 21:54:14 +01:00
4 changed files with 17 additions and 8 deletions

View File

@@ -172,7 +172,7 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
debugPrint("^5Debug^7: ^3Consume^7: ^2Event already started^7, ^1Cancelling^7.")
tempLockInv(false)
if Config.UseProgbar then
stopPropgressBar()
stopProgressBar()
else
triggerNotify(nil, "Stopped "..string, "error")
end
@@ -208,9 +208,17 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
debugPrint("^5Debug^7: ^3Consume^7: ^2Player Movement Flag^7 - ^6"..json.encode(MovementType).." ^7")
if Config.Main.UseProgbar then
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
else
consuming = false
end
end)
else
@@ -273,7 +281,7 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
tempLockInv(false)
hideText()
if Config.Main.UseProgbar then
stopPropgressBar()
stopProgressBar()
else
triggerNotify(nil, "Cancelled "..string, "error")
end
@@ -321,7 +329,7 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
hunger = hunger > 100 and 100 or hunger
elseif ESX and ESX.GetPlayerData then
hunger = (needStats.thirst / 100) * 1000000
hunger = (needStats.hunger / 100) * 1000000
hunger = hunger > 1000000 and 1000000 or hunger
end

View File

@@ -10,7 +10,7 @@ Config = {
},
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
},
Crafting = {

View File

@@ -1,6 +1,6 @@
name "Jim-Consumables"
author "Jimathy"
version "2.0.04"
version "2.0.05"
description "Consumables Script"
fx_version "cerulean"
game "gta5"

View File

@@ -1,5 +1,6 @@
2.0.04
2.0.05
- Fix hunger and thirst events
- Fix ESX Hunger events
- Fix minor progressBar option issues
https://github.com/jimathy/jim-consumables