Scullyy / scully_emotemenu

An emote menu for the FiveM community.
GNU General Public License v3.0
89 stars 58 forks source link

SetWalk function and QBCore #76

Open xMaddMackx opened 4 months ago

xMaddMackx commented 4 months ago

Describe the bug I've been using scully_emotemenu for a while with both QB and ESX. In ESX, I noticed that the player's current walking style persists even after a restart, which is the expected behavior. However, this wasn't the case with QB.

I suspected that the issue might be related to the way ox_lib caches the ped/player for QBCore. After setting up a brand new QB server, I decided to investigate further. I tried using the exports with the QBCore onPlayerLoaded event and added print statements to ensure the player's current walking style was being saved via KVP. Everything seemed fine, but the walking style still wouldn't persist.

Finally, I decided to remove the cache.ped and accessed the player entity directly using PlayerPedId(). This change made the walking style persist as intended in qb-core as well.

Resource version version '1.9.9f'

To Reproduce See the bug description above.

Expected behavior See the bug description above.

Screenshots image

Additional context I could probably dig a little deeper to figure out why the cache.ped doesn't work with QBCore, and if I find a better resolution I'll be sure to update you with my findings.

marshular commented 1 month ago

make a pr