Skip to content

Extra Controls

TrevorBarns edited this page Jan 5, 2022 · 2 revisions

⚠️ Notice: some features explained below are unreleased. Coming soon v3.2.7 (beta) and on.

Introduction

The "extra_controls" plugin handles specific extra toggling on demand using key bindings. The allows players the ability to toggle spotlights, light cuts, scene lights conveniently without navigating through existing menus. Controls can be set by default or left disabled, if allow_custom_controls is set to true, players can change each control combo and key in game through LVC menu.

Configuration

  1. Ensure that plugins_installed is set to true in lvc/SETTINGS.lua.

  2. Open the SETTINGS.lua located in lvc/plugins/extra_controls. Adjust settings to your liking.

  3. Determine a set of controls/combos that players can use. Configure the EXTRA_CONTROLS table to your liking.
    List of Controls: https://docs.fivem.net/docs/game-references/controls/

    ⚠️ Notice: Every default Combo and Key assignment need to be present at a minimum in the CONTROLS table.

    Example:

    CONTROLS = {
    	-- COMBOS = { <list of index/key ID of approved combo-keys> }, 
    	-- KEYS = { <list of index/key ID of approved toggle keys> }
    	COMBOS = { 326, 155, 19, 349 },    --LCTRL, LSHIFT, LALT, TAB
    	KEYS = { 187, 188, 189, 190, 20 }  -- ARROW DWN, UP, LFT, RGT, Z
    }
    
  4. Configure the EXTRA_CONTROLS table to your liking.
    Example:

    EXTRA_CONTROLS = {
    	['DEFAULT'] = { 	},	
    	['LAPD'] = { 
    			--  	{ '<name>', Extras = {<extras table>}, Combo = <default combo>, Key = <default key>, (opt.) Audio = < button soundFX> }
    				{ Name = 'Front Cut', Extras = {add = 8, remove = 9, repair = true}, Combo = 155, Key = 20, Audio = true }, 
    				{ Name = 'Scene Lights', Extras = {toggle = 9, repair = true}, Combo = 349, Key = 20, Audio = true }, 
    				{ Name = 'Pass. Spot Light', Extras = {add = 3, remove = 4, repair = true}, Combo = 326, Key = 20, Audio = false }, 
    	},	
    	['so3'] = { 
    			--  	{ '<name>', Extras = {<extras table>}, Combo = <default combo>, Key = <default key>, (opt.) Audio = < button soundFX> }
    				{ Name = 'Test', Extras = {add = 4, remove = 9, repair = true}, Combo = 155, Key = 20, Audio = true }, 
    				{ Name = 'Test2', Extras = {toggle = 5, repair = true}, Combo = 349, Key = 20, Audio = true }, 
    				{ Name = 'Test3', Extras = {add = 6, remove = 7, repair = true}, Combo = 326, Key = 20, Audio = false }, 
    	},
    }
    

Extras Table

Toggle

A toggle key will toggle a single extra on trigger or multiple extra if a table is passed in.

  • Single Example: Brake = { toggle = 1 }
  • Multiple Example: Brake = { toggle = { 1, 2, 3, ... n } }

Add & Remove

An add and remove key will add the passed extra(s) on trigger and remove passed extras(s) on trigger. When the control is pressed again, the behavior will reverse adding the removed extra(s) and removing the added extra(s).

  • Single Example: Brake = { add = 1, remove = 2 }
  • Multiple Example: Brake = { add = { 1, 3 }, remove = { 2, 4 } }

Repair Flag

A repair flag can optionally be added for higher poly extras. GTA will set extras of low poly items without repairing the vehicle, however for things like spotlights, lightbars, etc. the repair flag may need to be set. By default repair is set to disabled, to override add repair = true somewhere inside the desired trigger table.

  • Examples:
    • Brake = { toggle = 1, repair = true }
    • Takedowns = { add = { 5 }, remove = { 6 }, repair = true }

Controls

  • Combo: combokey to be pressed in addition to key in order to activate profile. Combo = 0 to disable the need for a combo key.
  • Key: control to be pressed with combokey (if set) in order to activate profile.

Audio

The audio flag determines if the plugin plays a button press soundfx (like heard when toggling siren) when the extra_control profile is toggled.

Finished ✅ , configure your personal settings in game under 'Plugins/Extra Control' menu.

User Documentation

Clone this wiki locally