Running into an issue with character switching where GetPlayer(source) is giving me stale data while the statebag already has the new character info. Happens when players switch chars quickly (2-3 seconds apart).
TriggerEvent('qb-multicharacter:server:spawnPlayer', src, newCharId)
-- After this, GetPlayer(src).PlayerData still shows old character data
local oldCash = QBCore.Functions.GetPlayer(src).PlayerData.money
local newCash = src.stateBag.playerData.money -- Different value!Console shows warnings about cash mismatches, player ped updates fine but inventory/job stuff stays from the old char. Vehicle ownership checks fail because they're reading from the cached player object instead of statebag.
Both characters exist in DB with different cash amounts, and statebag.playerData shows the correct new character info. Just seems like GetPlayer() isn't refreshing its internal cache properly?
Anyone run into this with rapid character switching? Running OneSync with default buckets, oxmysql backend.
NexusZero · 30/08/2026
Sign in to reply.