Compare commits

...

2 Commits

Author SHA1 Message Date
Jim Shield
ae231b6101 Version Bump
`2.0.23` - `2.1.0`
2025-09-14 21:32:12 +01:00
Jim Shield
c709159ea4 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.
2025-09-14 17:40:12 +01:00
4 changed files with 58 additions and 56 deletions

View File

@@ -1,6 +1,6 @@
name "Jim_Bridge"
author "Jimathy"
version "2.0.23"
version "2.1.0"
description "Framework Bridge By Jimathy"
fx_version "cerulean"
rdr3_warning 'I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships.'

View File

@@ -25,7 +25,6 @@ local function awaitWithTimeout(registerFn, timeoutMs)
return nil, res
end
--- Registers a callback function with the appropriate framework.
---
--- This function checks which framework is started (e.g., OX, QB, ESX) and registers the callback accordingly.

View File

@@ -130,12 +130,13 @@ end)
--- @param type string "thirst" or "hunger".
--- @param amount number New value to set.
RegisterNetEvent(getScript()..":server:setNeed", function(needType, amount)
local src = source
if needType == "thirst" then
setThirst(src, amount)
elseif needType == "hunger" then
setHunger(src, amount)
end
print("^1Deprecated function ':server:setNeed' called, please update your scripts^7")
-- local src = source
-- if needType == "thirst" then
-- setThirst(src, amount)
-- elseif needType == "hunger" then
-- setHunger(src, amount)
-- end
end)
-------------------------------------------------------------
@@ -322,41 +323,42 @@ end
--- ConsumeSuccess("beer", "alcohol")
--- ```
function ConsumeSuccess(itemName, type, data)
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)
if isStarted(ESXExport) then
if hunger then
TriggerServerEvent(getScript()..":server:setNeed", "hunger", tonumber(hunger) * 10000)
end
if thirst then
TriggerServerEvent(getScript()..":server:setNeed", "thirst", tonumber(thirst) * 10000)
end
else
if hunger then
TriggerServerEvent(getScript()..":server:setNeed", "hunger", Core.Functions.GetPlayerData().metadata["hunger"] + tonumber(hunger))
end
if thirst then
TriggerServerEvent(getScript()..":server:setNeed", "thirst", Core.Functions.GetPlayerData().metadata["thirst"] + tonumber(thirst))
end
end
if type == "alcohol" then
alcoholCount = (alcoholCount or 0) + 1
if alcoholCount > 1 and alcoholCount < 4 then
TriggerEvent("evidence:client:SetStatus", "alcohol", 200)
elseif alcoholCount >= 4 then
TriggerEvent("evidence:client:SetStatus", "heavyalcohol", 200)
AlienEffect()
end
end
if Config.Reward then
getRandomReward(itemName)
end
print("^1Deprecated function 'ConsumeSuccess' called, please update your scripts^7")
--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)
--
--if isStarted(ESXExport) then
-- if hunger then
-- TriggerServerEvent(getScript()..":server:setNeed", "hunger", tonumber(hunger) * 10000)
-- end
-- if thirst then
-- TriggerServerEvent(getScript()..":server:setNeed", "thirst", tonumber(thirst) * 10000)
-- end
--else
-- if hunger then
-- TriggerServerEvent(getScript()..":server:setNeed", "hunger", Core.Functions.GetPlayerData().metadata["hunger"] + tonumber(hunger))
-- end
-- if thirst then
-- TriggerServerEvent(getScript()..":server:setNeed", "thirst", Core.Functions.GetPlayerData().metadata["thirst"] + tonumber(thirst))
-- end
--end
--
--if type == "alcohol" then
-- alcoholCount = (alcoholCount or 0) + 1
-- if alcoholCount > 1 and alcoholCount < 4 then
-- TriggerEvent("evidence:client:SetStatus", "alcohol", 200)
-- elseif alcoholCount >= 4 then
-- TriggerEvent("evidence:client:SetStatus", "heavyalcohol", 200)
-- AlienEffect()
-- end
--end
--
--if Config.Reward then
-- getRandomReward(itemName)
--end
end
-------------------------------------------------------------

View File

@@ -1,15 +1,16 @@
2.0.22
2.1.0
- Support for qs-interface
- Fix polyzone minZ + maxZ handling
- Fix ox_target zone location to match qb-target
- Fix "Waiting for script start" loop bug
- Add condition for fading in entities
- Fix typo breaking scripts on gta skillbar fail
- Fix typo for gksphone invoice event
- Fix latio_ui TextUI placement
- Remove registerShop debug message
- Fix typo in print when removing codem stash item
- Fix function typo from origen inv documenation
- Script Overhaul, replace whole script
- Very alpha support for VorpCore
- Improve security
- Removal of Quasar Script Support
- Support Tgiann-inv's new item system
- Refactor most multi-functions to be more optimized and smarter
- Added multifunction bossmenu and clothing functions
- Added ability to supress update notifcations in fxmanfiest.lua
- Added coordinate checks to registerStash, registerShop and sellShop
- Optimize and Enhance built-in progressbar + target functions
- Improve weird multicharacter issue triggering onPlayerLoaded more than once
- Scripts that use this will need updating too, as things like stashes won't open
https://github.com/jimathy/jim_bridge
https://github.com/jimathy/jim_bridge/releases/latest