* Fix: Skillcheck animation speed inconsistencies by switching to time-based RAF loop
This PR fixes long-standing issues with the skillcheck mini-game animation speed being inconsistent across machines and after long play sessions. Some players reported extremely slow indicator movement, others extremely fast, and many noticed that the speed changed unpredictably the longer they stayed logged in.
The root cause was that the skillcheck relied on a useInterval tick (setInterval-like behavior) and assumed it fired every 1ms. In reality, browser timer clamping and throttling make interval timing highly unpredictable — especially in embedded CEF browsers like FiveM’s NUI.
This PR replaces tick-based animation with a time-based requestAnimationFrame loop using performance.now(), ensuring perfectly consistent animation timing across all hardware and browser states. I have used this method in other NUI based skillcheck scripts to address this same behavior.
Signed-off-by: Senlar <brandonrhue@gmail.com>
* Refactor keyHandler and clean up code
Signed-off-by: Senlar <brandonrhue@gmail.com>
* Refactor keyHandler and cleanup useEffect logic again
Signed-off-by: Senlar <brandonrhue@gmail.com>
---------
Signed-off-by: Senlar <brandonrhue@gmail.com>
Hello,
I’d like to propose a small improvement to vehicle properties handling.
This change adds support for the vehicle door lock state (lockState) by:
- Including lockState in the VehicleProperties type
- Reading the value using GetVehicleDoorLockStatus in getVehicleProperties
- Applying the value using SetVehicleDoorsLocked in setVehicleProperties
This allows vehicle lock status to be properly saved and restored alongside other vehicle properties.
Let me know if this fits the project direction or if any adjustments are needed.
This allows the vehicle lock status to be properly saved and restored alongside other vehicle properties.
Note: Two additional commits and pull requests were accidentally opened during this process and have already been closed. Sorry for the noise.
Thank you!
Signed-off-by: Angelo Rodrigues De Morais Barroso <115129101+Angelo90810@users.noreply.github.com>
- The previous fix (commit df7a6b9) mistakenly left in a table.type
/ #t1 == #t2 check that breaks equality for {} and {x=nil}.
- This removes that leftover check, restoring the intended deep
equality semantics.
Signed-off-by: RuksH4n <77233680+rukshanchamindu@users.noreply.github.com>
- The refactor in [Commit 4c460e0](4c460e0bd9) introduced stricter type checks (using table.type and array length comparison), which caused empty tables and tables with nil values to be considered unequal.
- This commit removes the strict shape checks and restores the original deep equality semantics, ensuring {} == {x=nil}.
Signed-off-by: RuksH4n <77233680+rukshanchamindu@users.noreply.github.com>
MarkerType alias was replaced for an enum.
The type property in MarkerProps class is now optional, MarkerType or an integer (UpsideDownCone if missing).
The properties inside color are now defined as integers.
Added invert property, documented by CFX as drawOnEnts.
Added marker_mt metatable that stores default properties and draw method.
Signed-off-by: Sergio <89666307+feelfreetofee@users.noreply.github.com>