Open mafewtm opened 8 months ago
I'm pretty confident this is where the issue lies. A check if the user is "logged in" should probably be performed before getting the users location: https://github.com/Qbox-project/qbx_core/blob/main/server/player.lua#L492
I managed to replicate it.
AddEventHandler('populationPedCreating', function(x, y, z)
Wait(500) -- Give the entity some time to be created
local handle = GetClosestPed(vec3(x,y,z)) -- This is an invalid native call, not enough arguments passed
SetPedDropsWeaponsWhenDead(handle, false)
end)
Summary
Sometimes if you leave your server after you see the character selection screen, once you rejoin and spawn in at last location, itll spawn you inside the room
Reproduction
- Load into your server
- (Not sure if you need to select your character first or if you just load in and touch nothing...or both might cause it maybe)
- Log out of your server
- Load back into your server
- Select a character
- Select a spawn or if you arent using qbx_spawn, do nothing
- You'll load into the multicharacter character selection room instead of previous last location
Expected behavior
Your characters last location shouldnt be saved while in character selection
Actual behavior
It saves
Additional context
Might be something in the multicharacter or just how the last location is saved. Not too sure
Current Version
v1.6.1
Custom Resources
N/A
can confirm this, i though it was my multichar issue but apparently its not @_@
So when selecting a character SetMetaData gets triggert 3 times because of: https://github.com/Qbox-project/qbx_medical/blob/main/server/main.lua#L35 and https://github.com/Qbox-project/qbx_police/blob/main/server/main.lua#L325 qbx_medical wil trigger the Save() function because: https://github.com/Qbox-project/qbx_core/blob/main/server/player.lua#L1004
Here we store the last location: https://github.com/Qbox-project/qbx_core/blob/main/server/player.lua#L1006
Now it is possible that before you load in fully that sometimes https://github.com/Qbox-project/qbx_core/blob/main/server/loops.lua#L3 will run and save the pos from the multicharacter location and state inApartment
or inProperty
is true and therefore will not update the last location?
After you select a character it will save the multicharacter location 2 times because of isdead
and inlaststand
from qbx_medical server/main.lua#L35
but whatever i try i cannot reproduce this issue because the last location will update correctly.
Does anyone has this issue with the latest version?
Summary
Sometimes if you leave your server after you see the character selection screen, once you rejoin and spawn in at last location, itll spawn you inside the room
Reproduction
Expected behavior
Your characters last location shouldnt be saved while in character selection
Actual behavior
It saves
Additional context
Might be something in the multicharacter or just how the last location is saved. Not too sure
Current Version
v1.6.1
Custom Resources
N/A