Hey everyone, running into a weird issue with the default QBCore DMV system. When I pass the driving test on one character, then switch to another character, that second character also shows as having passed the DMV test. Same thing happens with failed attempts - if I fail on char1 then switch to char2, char2 can't take the test because it thinks I already failed.
I've been trying to clear the statebags when unloading characters like this:
RegisterNetEvent('QBCore:Client:OnPlayerUnload')
AddEventHandler('QBCore:Client:OnPlayerUnload', function()
local state = PlayerPedId().state
state:remove('dmv_result')
state:remove('dmv_test_active')
end)But it's still not working properly. The statebags seem to persist across character switches even after calling remove(). Checked the server console and I can see the dmv_result value still hanging around after Character.Unload fires.
Anyone run into this before? Is there some character-specific namespace I should be using for statebags or am I going about this completely wrong?
Using latest QBCore with OneSync enabled if that matters.
DarkKnight · 04/09/2026
Sign in to reply.