Add GetHunger and GetThirst functions to frameworks

Introduced GetHunger and GetThirst functions to client and server files for es_extended, qb-core, and qbx_core frameworks. These functions return the player's hunger and thirst values rounded to the nearest integer, improving consistency in status retrieval.
This commit is contained in:
MrNewb committed 2025-09-10 11:29:41 -04:00
1 parent 371ee19445
commit 87345fafce
5 files changed
+58 -4

No files matched your search

+2 -2
View File
@@ -257,7 +257,7 @@ Framework.GetHunger = function(src)
for _, entry in ipairs(status) do
if entry.name == "hunger" then
return math.floor(entry.percent)
return math.floor((entry.percent) + 0.5) or 0
end
end
end
@@ -271,7 +271,7 @@ Framework.GetThirst = function(src)
for _, entry in ipairs(status) do
if entry.name == "thirst" then
return math.floor(entry.percent)
return math.floor((entry.percent) + 0.5) or 0
end
end
end