Currently there's no way to tell whenever your client switched routing bucket, and a getter for which routing bucket you are in. Therefor this PR aims to add a feature which is already present in other frameworks this will help developers to easier support for qb-core throughout scripts, which requires this.
Usage
local playerId = PlayerId()
AddStateBagChangeHandler('instance', ('player:%s'):format(playerId), function(_, _, bucket)
print("You just entered bucket", bucket)
end)
Checklist
[x] I have personally loaded this code into an updated qbcore project and checked all of its functionality.
Description
Currently there's no way to tell whenever your client switched routing bucket, and a getter for which routing bucket you are in. Therefor this PR aims to add a feature which is already present in other frameworks this will help developers to easier support for qb-core throughout scripts, which requires this.
Usage
Checklist