Latest FiveM update seems to have broken IsPlayerFreeAiming

Today I noticed that two things on my server don’t work, whereas I didn’t make a change there during the last month. These are: automatically changing the perspective to FPS when aiming and adding a door to nui_doorlock using /newdoor.
Both use the native IsPlayerFreeAiming(PlayerId()), which seems to always return false now.

I can’t replicate this issue, the native seems to work fine:

CreateThread(function()
    while true do
        Wait(50)

        print(IsPlayerFreeAiming(PlayerId()))
    end
end)

image

It doesn’t.
I ran the exact code you pasted and I still get false.


I’m running latest version Canary channel on game build 2189.

You seem to have a lot of other random resources running. I just ran the snippet in runcode, any difference between that and your ‘test’ resource?

Yes I am running a lot of resources, but I don’t think any of those could overwrite a native in an isolated resource.
No difference at all, apart from the manifest which looks like that:

fx_version "cerulean"
game "gta5"

client_script "client.lua"

Hey !
Do you have any resource that use : SetPlayerLockon() ?

Yes, I do, as a way to prevent auto-aim.

Alright me two, then that’s probably why

Has anyone figured this out currently have the same issue

1 Like

It was literally ‘figured out’ two messages above yours.

Yes. Just don’t use SetPlayerLockon() - it is the cause.

I just used a fresh install of a new server still the same issue that why I’m asking so it wasn’t “literally figured out two messages above yours”

1 Like

Hello guys, if you are using SetPlayerLockon() and you need to check if the ped is aiming or not just use GetPedConfigFlag(PlayerPedId(), 78) it will work.

5 Likes