Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.3.0 - Passenger control update #16

Merged
merged 130 commits into from
Mar 21, 2021
Merged

1.3.0 - Passenger control update #16

merged 130 commits into from
Mar 21, 2021

Conversation

WolfKnight98
Copy link
Owner

New

  • Added passenger view and control. This new update allows front seat passengers to view and control the radar/plate reader of the driver, there are two variables in the config.lua file that control this: passenger view and passenger control. When passenger view is enabled, the passenger will be able to open their remote and toggle their displays for the radar and plate reader. When passenger control is enabled, the passenger will be able to use all the radar and plate reader functions like normal, but it is synced between the driver and passenger.
  • Added callbacks to all Lua NUI events to prevent requests from stalling (thanks Jamelele on GitHub).
  • Added a button to the plate reader window to clear the current BOLO plate.
  • UI settings now get loaded again if the resource gets restarted live.
  • Added a client console message for when the key binds are being registered.
  • Added an option in config.lua to automatically lock speeds only if the speeding vehicle has a real player as the driver.
  • Added a notification when using /reset_radar_data to indicate the resource's KVPs have been reset.
  • Added a chat suggestion for the /reset_radar_data command.
  • Added an option in config.lua for users of Sonoran CAD. When enabled, this reduces the amount that the plate reader system triggers the wk:onPlateScanned event, so it will only trigger the event if the scanned plate has a player in it or belongs to a player.
  • Added options in config.lua to set the default fast lock state and fast limit for the operator menu. This only applies if fast lock is enabled.

Changes

  • Changed the JavaScript NUI post event to HTTPS instead of HTTP (thanks Jamelele on GitHub).
  • Updated the fx_version to "cerulean".
  • Removed dynamic resource naming, this caused too many problems for clients regarding key binds not working or UI elements not displaying. To help reduce the amount of key bind and UI problems, the resource is now hardcoded to use wk_wars2x as the resource name. If the resource name is not wk_wars2x, an error message will be printed to the server console, and the key binds will not be registered client side.
  • Changed the key binds system so that the commands and keys now get registered when the player first spawns in instead of when the script first loads.
  • Changed the key lock message to be clearer.
  • Reduced the default scale from 1.0 to 0.75 in config.lua.
  • Closing the remote will now close the operator menu if open.
  • Reduced the size of the server console branding.
  • Updated the copyright range in the files.
  • Removed the provided jQuery file to use the built-in FiveM jQuery library.
  • A plethora of other code refactors, additions, and deletions. If you would like to see a list of all changes, view the GitHub repository.

Fixes

  • Fixed spamming the power button breaking the radar display.
  • Fixed the fast display operator menu option being ignored on radar power up.

The driver and passenger of a vehicle should now be able to run radar independently, this is a very early implementation as there is no syncing between players. If the driver locks a speed, the passenger's radar will be unchanged, and so on.
Key binds now get registered only when the player has spawned in, rather than when the code gets run at the bottom of the file.
The key lock message now reads "Radar key binds enabled" and "Radar key binds blocked". Green and red are also used to signify the state of the key binds, this hopefully makes it a bit more clear what it does, as well as the state of the key lock.
If the resource's name is not wk_wars2x, then the server console will receive an error.
If CONFIG.allow_passenger_control is set to true, then the passenger can turn on the power.
The system was restoring the data, but not updating the NUI side.
This was caused because I used the RADAR:IsMenuOpen() function to control if audio should be played. This is so if one player is in the operator menu, and the other locks a speed, the audio is not played for the player in the operator menu. The variable 'isMenuOpen' just needed inverting.
@WolfKnight98 WolfKnight98 merged commit 9b88f75 into master Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants