Comments (4)
fix manason pls
from qbx_core.
AddEventHandler('qbx_core:server:onSetMetaData', function(key, _, new, source)
if key == 'hunger' or key == 'thirst' or key == 'stress' then
Player(source).state:set(key, new, true)
end
end)
from qbx_core.
nvm looks like the state is being synced in the self.Functions.SetMetaData. but still experiencing the desynced values between metadata and state for status. will work on a repro
from qbx_core.
local PlayerState = LocalPlayer.state
CreateThread(function ()
while true do
print("ON LOOP")
lib.print.info("STATE:", "HUNGER:", PlayerState.hunger)
lib.print.info("STATE:", "THIRST:", PlayerState.thirst)
lib.print.info("META:", "HUNGER:", QBX.PlayerData.metadata.hunger)
lib.print.info("META:", "THIRST:", QBX.PlayerData.metadata.thirst)
Wait(500)
print("========================================================")
end
end)
RegisterCommand('addhunger', function ()
TriggerServerEvent('consumables:server:addHunger', QBX.PlayerData.metadata.hunger + 1000) --- this event just sets the hunger using setMetaData function
end)
RegisterCommand('addthirst', function ()
TriggerServerEvent('consumables:server:addThirst', QBX.PlayerData.metadata.thirst + 1000)--- this event just sets the thirst using setMetaData function
end)
RegisterNetEvent('hud:client:UpdateNeeds', function (hunger, thirst)
print("ON UPDATE")
lib.print.info("STATE:", "HUNGER:", PlayerState.hunger)
lib.print.info("STATE:", "THIRST:", PlayerState.thirst)
lib.print.info("META:", "HUNGER:", QBX.PlayerData.metadata.hunger)
lib.print.info("META:", "THIRST:", QBX.PlayerData.metadata.thirst)
print("========================================================")
end)
here is a repro and then also i made a pr #459
from qbx_core.
Related Issues (20)
- Incorrect string value for column name (DB encoding)
- Add last_updated to PlayerData
- Add compat for QBCore.Functions.StarterItems
- Deleting a character fails on clean qbox installs HOT 3
- You can have more than the amount of jobs set via qbx:max_jobs_per_player
- Routing buckets related to vehicles is not functioning properly HOT 1
- player_groups deletes HOT 4
- Player_group table HOT 6
- [REQUEST] Keys Core Commands HOT 3
- Values swap randomly when doing commands
- Vehicle spawning in buckets does not work HOT 3
- commands with numbers are partially broken
- [Possible Bug] Duty Status is Setting Incorrectly at Login (Not defaulting to what the shared/jobs.lua has in place) HOT 2
- SCRIPT ERROR: @illenium-appearance/game/util.lua:233: attempt to index a nil value (local 'headOverlay') HOT 2
- I tried this https://github.com/Qbox-project/qbx_core/pull/450#issue-2254326187
- playerState return nulls while checking for hunger and thirst
- Health draining instantly after spawning HOT 7
- Can't select a birthday after changing date format HOT 1
- Ban Checking HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qbx_core.