mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-19 14:56:02 +01:00
Change stress to take away instead of increase
This commit is contained in:
@@ -86,7 +86,7 @@ local hungerThirstFunc = {
|
|||||||
setStress =
|
setStress =
|
||||||
function(src, stress)
|
function(src, stress)
|
||||||
local Player = Core.Functions.GetPlayer(src)
|
local Player = Core.Functions.GetPlayer(src)
|
||||||
local newStress = Player.PlayerData.metadata.stress + stress
|
local newStress = Player.PlayerData.metadata.stress - stress
|
||||||
newStress = (newStress >= 100.0 and 100.0) or (newStress <= 0 and 0) or newStress
|
newStress = (newStress >= 100.0 and 100.0) or (newStress <= 0 and 0) or newStress
|
||||||
Player.Functions.SetMetaData('stress', newStress)
|
Player.Functions.SetMetaData('stress', newStress)
|
||||||
TriggerClientEvent('hud:client:UpdateStress', src, newStress)
|
TriggerClientEvent('hud:client:UpdateStress', src, newStress)
|
||||||
@@ -187,10 +187,10 @@ end)
|
|||||||
--- Server event handler for setting player needs (thirst or hunger).
|
--- Server event handler for setting player needs (thirst or hunger).
|
||||||
---
|
---
|
||||||
--- @event
|
--- @event
|
||||||
--- @param type string "thirst" or "hunger".
|
--- @param needType string "thirst" or "hunger".
|
||||||
--- @param amount number New value to set.
|
--- @param amount number New value to set.
|
||||||
RegisterNetEvent(getScript()..":server:setNeed", function(needType, amount)
|
RegisterNetEvent(getScript()..":server:setNeed", function(needType, amount)
|
||||||
print("^1Deprecated function ':server:setNeed' called, please update your scripts^7")
|
print("^1Deprecated function ':server:setNeed' called, please update the scripts that use it^7")
|
||||||
-- local src = source
|
-- local src = source
|
||||||
-- if needType == "thirst" then
|
-- if needType == "thirst" then
|
||||||
-- setThirst(src, amount)
|
-- setThirst(src, amount)
|
||||||
|
|||||||
Reference in New Issue
Block a user