mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-19 14:56:02 +01:00
Deprecate ConsumeSuccess()
This function and others were too open to exploiters, my scripts not no longer use these functions and handle it all server side.
This commit is contained in:
@@ -130,12 +130,13 @@ end)
|
|||||||
--- @param type string "thirst" or "hunger".
|
--- @param type 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)
|
||||||
local src = source
|
print("^1Deprecated function ':server:setNeed' called, please update your scripts^7")
|
||||||
if needType == "thirst" then
|
-- local src = source
|
||||||
setThirst(src, amount)
|
-- if needType == "thirst" then
|
||||||
elseif needType == "hunger" then
|
-- setThirst(src, amount)
|
||||||
setHunger(src, amount)
|
-- elseif needType == "hunger" then
|
||||||
end
|
-- setHunger(src, amount)
|
||||||
|
-- end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
@@ -322,41 +323,42 @@ end
|
|||||||
--- ConsumeSuccess("beer", "alcohol")
|
--- ConsumeSuccess("beer", "alcohol")
|
||||||
--- ```
|
--- ```
|
||||||
function ConsumeSuccess(itemName, type, data)
|
function ConsumeSuccess(itemName, type, data)
|
||||||
local hunger = data and data.hunger or Items[itemName].hunger
|
print("^1Deprecated function 'ConsumeSuccess' called, please update your scripts^7")
|
||||||
local thirst = data and data.thirst or Items[itemName].thirst
|
--local hunger = data and data.hunger or Items[itemName].hunger
|
||||||
|
--local thirst = data and data.thirst or Items[itemName].thirst
|
||||||
ExecuteCommand("e c")
|
--
|
||||||
removeItem(itemName, 1)
|
--ExecuteCommand("e c")
|
||||||
|
--removeItem(itemName, 1)
|
||||||
if isStarted(ESXExport) then
|
--
|
||||||
if hunger then
|
--if isStarted(ESXExport) then
|
||||||
TriggerServerEvent(getScript()..":server:setNeed", "hunger", tonumber(hunger) * 10000)
|
-- if hunger then
|
||||||
end
|
-- TriggerServerEvent(getScript()..":server:setNeed", "hunger", tonumber(hunger) * 10000)
|
||||||
if thirst then
|
-- end
|
||||||
TriggerServerEvent(getScript()..":server:setNeed", "thirst", tonumber(thirst) * 10000)
|
-- if thirst then
|
||||||
end
|
-- TriggerServerEvent(getScript()..":server:setNeed", "thirst", tonumber(thirst) * 10000)
|
||||||
else
|
-- end
|
||||||
if hunger then
|
--else
|
||||||
TriggerServerEvent(getScript()..":server:setNeed", "hunger", Core.Functions.GetPlayerData().metadata["hunger"] + tonumber(hunger))
|
-- if hunger then
|
||||||
end
|
-- TriggerServerEvent(getScript()..":server:setNeed", "hunger", Core.Functions.GetPlayerData().metadata["hunger"] + tonumber(hunger))
|
||||||
if thirst then
|
-- end
|
||||||
TriggerServerEvent(getScript()..":server:setNeed", "thirst", Core.Functions.GetPlayerData().metadata["thirst"] + tonumber(thirst))
|
-- if thirst then
|
||||||
end
|
-- TriggerServerEvent(getScript()..":server:setNeed", "thirst", Core.Functions.GetPlayerData().metadata["thirst"] + tonumber(thirst))
|
||||||
end
|
-- end
|
||||||
|
--end
|
||||||
if type == "alcohol" then
|
--
|
||||||
alcoholCount = (alcoholCount or 0) + 1
|
--if type == "alcohol" then
|
||||||
if alcoholCount > 1 and alcoholCount < 4 then
|
-- alcoholCount = (alcoholCount or 0) + 1
|
||||||
TriggerEvent("evidence:client:SetStatus", "alcohol", 200)
|
-- if alcoholCount > 1 and alcoholCount < 4 then
|
||||||
elseif alcoholCount >= 4 then
|
-- TriggerEvent("evidence:client:SetStatus", "alcohol", 200)
|
||||||
TriggerEvent("evidence:client:SetStatus", "heavyalcohol", 200)
|
-- elseif alcoholCount >= 4 then
|
||||||
AlienEffect()
|
-- TriggerEvent("evidence:client:SetStatus", "heavyalcohol", 200)
|
||||||
end
|
-- AlienEffect()
|
||||||
end
|
-- end
|
||||||
|
--end
|
||||||
if Config.Reward then
|
--
|
||||||
getRandomReward(itemName)
|
--if Config.Reward then
|
||||||
end
|
-- getRandomReward(itemName)
|
||||||
|
--end
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user