I assume so, as that is how a player is put into an idle camera and then taken out of it. Is there a specific native for this?
Asking because currently there exist multiple resources where a player is put into idle animations after a certain period by checking if certain conditions are met (not dead, not moving, etc), but this seems like it’s doing what GTA already does.
For example:
they then need to check if a player has pressed certain keys to cancel the animations. If we can check if a player is idle or not, we wouldn’t need to do this. Been searching through the docs and only thing I could find is:
DisableIdleCamera
InvalidateIdleCam
and other natives for disabling and stopping idle animations. None of them seem to detect if a player is idle and when they are no longer idle.
I think that would just tell if the cinematic camera is running no?
Not detect if the player has reached 30 seconds of idle time. I assume there are instances where Rockstar would want to detect if a player was idle without them being in in the cinematic camera.
Or by capturing mouse location and checking wether or not its mooving:
local sx, sy = GetActiveScreenResolution()
local cx_base, cy_base = GetNuiCursorPosition()
local cx, cy = (cx_base / sx), (cy_base / sy)
print(("Mousepos X: %s, Mousepos Y: %s"):format(cx, cy))
This method is better if you are trying to detect general movement. However you need to note that the mouseposition changes even if you are NOT INGAME. Checking for window Focus is a far more sophiscitated check that you can achieve with clever native usage.