mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 08:26:27 +02:00
Merge pull request #3 from blockba5her/master
switch from gta controls to fivem key maps
This commit is contained in:
53
cl_radar.lua
53
cl_radar.lua
@@ -1804,58 +1804,53 @@ Citizen.CreateThread( function()
|
|||||||
end
|
end
|
||||||
end )
|
end )
|
||||||
|
|
||||||
function RunControlManager()
|
|
||||||
-- Make sure only the keyboard works
|
|
||||||
if ( IsInputDisabled( 0 ) and not IsPauseMenuActive() ) then
|
|
||||||
if ( not RADAR:GetKeyLockState() ) then
|
|
||||||
local keyType = RADAR:GetKeybindType()
|
|
||||||
|
|
||||||
-- Opens the remote control
|
-- Opens the remote control
|
||||||
if ( IsDisabledControlJustPressed( 1, CONFIG.keys.remote_control ) ) then
|
RegisterCommand('radar_remote', function()
|
||||||
|
if ( not RADAR:GetKeyLockState() ) then
|
||||||
RADAR:OpenRemote()
|
RADAR:OpenRemote()
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
|
RegisterKeyMapping("radar_remote", "Open Radar Remote", "keyboard", CONFIG.keyDefaults.remote_control)
|
||||||
|
|
||||||
-- Locks speed from front antenna
|
-- Locks speed from front antenna
|
||||||
if ( IsDisabledControlJustPressed( 1, CONFIG.keys[keyType].front_lock ) ) then
|
RegisterCommand('radar_fr_ant', function()
|
||||||
|
if ( not RADAR:GetKeyLockState() ) then
|
||||||
RADAR:LockAntennaSpeed( "front" )
|
RADAR:LockAntennaSpeed( "front" )
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
|
RegisterKeyMapping("radar_fr_ant", "Front Antenna Lock", "keyboard", CONFIG.keyDefaults.front_lock)
|
||||||
|
|
||||||
-- Locks speed from rear antenna
|
-- Locks speed from rear antenna
|
||||||
if ( IsDisabledControlJustPressed( 1, CONFIG.keys[keyType].rear_lock ) ) then
|
RegisterCommand('radar_bk_ant', function()
|
||||||
|
if ( not RADAR:GetKeyLockState() ) then
|
||||||
RADAR:LockAntennaSpeed( "rear" )
|
RADAR:LockAntennaSpeed( "rear" )
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
|
RegisterKeyMapping("radar_bk_ant", "Rear Antenna Lock", "keyboard", CONFIG.keyDefaults.rear_lock)
|
||||||
|
|
||||||
-- Locks front plate reader
|
-- Locks front plate reader
|
||||||
if ( IsDisabledControlJustPressed( 1, CONFIG.keys[keyType].plate_front_lock ) ) then
|
RegisterCommand('radar_fr_cam', function()
|
||||||
|
if ( not RADAR:GetKeyLockState() ) then
|
||||||
READER:LockCam( "front", true, false )
|
READER:LockCam( "front", true, false )
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
|
RegisterKeyMapping("radar_fr_cam", "Front Plate Reader Lock", "keyboard", CONFIG.keyDefaults.plate_front_lock)
|
||||||
|
|
||||||
-- Locks front plate reader
|
-- Locks rear plate reader
|
||||||
if ( IsDisabledControlJustPressed( 1, CONFIG.keys[keyType].plate_rear_lock ) ) then
|
RegisterCommand('radar_bk_cam', function()
|
||||||
|
if ( not RADAR:GetKeyLockState() ) then
|
||||||
READER:LockCam( "rear", true, false )
|
READER:LockCam( "rear", true, false )
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
-- Toggles between the keybind types
|
RegisterKeyMapping("radar_bk_cam", "Rear Plate Reader Lock", "keyboard", CONFIG.keyDefaults.plate_rear_lock)
|
||||||
if ( IsDisabledControlJustPressed( 1, CONFIG.keys.switch_keys ) ) then
|
|
||||||
RADAR:ToggleFullKeyboard()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Toggles the key lock state
|
-- Toggles the key lock state
|
||||||
if ( IsDisabledControlJustPressed( 1, CONFIG.keys.key_lock ) ) then
|
RegisterCommand('radar_key_lock', function()
|
||||||
RADAR:ToggleKeyLock()
|
RADAR:ToggleKeyLock()
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Control manager
|
|
||||||
Citizen.CreateThread( function()
|
|
||||||
while ( true ) do
|
|
||||||
RunControlManager()
|
|
||||||
|
|
||||||
Citizen.Wait( 0 )
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
RegisterKeyMapping("radar_key_lock", "Toggle Keybind Lock", "keyboard", CONFIG.keyDefaults.key_lock)
|
||||||
|
|
||||||
|
|
||||||
-- Deletes all of the KVPs
|
-- Deletes all of the KVPs
|
||||||
RegisterCommand( "reset_radar_data", function()
|
RegisterCommand( "reset_radar_data", function()
|
||||||
|
|||||||
49
config.lua
49
config.lua
@@ -43,58 +43,27 @@ CONFIG.allow_fast_limit = false
|
|||||||
-- open the remote.
|
-- open the remote.
|
||||||
CONFIG.allow_quick_start_video = true
|
CONFIG.allow_quick_start_video = true
|
||||||
|
|
||||||
-- Sets all of the controls
|
-- Sets the defaults of all keybinds
|
||||||
CONFIG.keys =
|
-- These keybinds can be changed by each person in their GTA Settings->Keybinds->FiveM
|
||||||
|
CONFIG.keyDefaults =
|
||||||
{
|
{
|
||||||
-- Remote control key
|
-- Remote control key
|
||||||
-- The default key to open the remote control is 166 (F5 - INPUT_SELECT_CHARACTER_MICHAEL)
|
remote_control = 'f5',
|
||||||
remote_control = 166,
|
|
||||||
|
|
||||||
-- Radar key lock key
|
-- Radar key lock key
|
||||||
-- The default key to enable/disable the radar key lock is 182 (L - INPUT_CELLPHONE_CAMERA_FOCUS_LOCK)
|
key_lock = 'l',
|
||||||
key_lock = 182,
|
|
||||||
|
|
||||||
-- Radar keybinds switch
|
|
||||||
-- The default key to switch the bind set is (K - INPUT_REPLAY_SHOWHOTKEY)
|
|
||||||
switch_keys = 311,
|
|
||||||
|
|
||||||
-- Keys for a full size keyboard
|
|
||||||
[ "full" ] = {
|
|
||||||
-- Radar front antenna lock/unlock Key
|
-- Radar front antenna lock/unlock Key
|
||||||
-- The default full keyboard key to lock/unlock the front antenna is 111 (Numpad 8 - INPUT_VEH_FLY_PITCH_UP_ONLY)
|
front_lock = 'numpad8',
|
||||||
front_lock = 111,
|
|
||||||
|
|
||||||
-- Radar rear antenna lock/unlock Key
|
-- Radar rear antenna lock/unlock Key
|
||||||
-- The default full keyboard key to lock/unlock the rear antenna is 112 (Numpad 5 - INPUT_VEH_FLY_PITCH_DOWN_ONLY)
|
rear_lock = 'numpad5',
|
||||||
rear_lock = 112,
|
|
||||||
|
|
||||||
-- Plate reader front lock/unlock Key
|
-- Plate reader front lock/unlock Key
|
||||||
-- The default full keyboard key to lock/unlock the front plate reader is 118 (Numpad 9 - INPUT_VEH_FLY_SELECT_TARGET_RIGHT)
|
plate_front_lock = 'numpad9',
|
||||||
plate_front_lock = 118,
|
|
||||||
|
|
||||||
-- Plate reader rear lock/unlock Key
|
-- Plate reader rear lock/unlock Key
|
||||||
-- The default full keyboard key to lock/unlock the rear plate reader is 109 (Numpad 6 - INPUT_VEH_FLY_ROLL_RIGHT_ONLY)
|
plate_rear_lock = 'numpad6'
|
||||||
plate_rear_lock = 109
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Keys for smaller keyboards
|
|
||||||
[ "small" ] = {
|
|
||||||
-- Radar front antenna lock/unlock Key
|
|
||||||
-- The default small keyboard key to lock/unlock the front antenna is 157 (1 - INPUT_SELECT_WEAPON_UNARMED)
|
|
||||||
front_lock = 157,
|
|
||||||
|
|
||||||
-- Radar rear antenna lock/unlock Key
|
|
||||||
-- The default small keyboard key to lock/unlock the rear antenna is 158 (2 - INPUT_SELECT_WEAPON_MELEE)
|
|
||||||
rear_lock = 158,
|
|
||||||
|
|
||||||
-- Plate reader front lock/unlock Key
|
|
||||||
-- The default small keyboard key to lock/unlock the front plate reader is 160 (3 - INPUT_SELECT_WEAPON_SHOTGUN)
|
|
||||||
plate_front_lock = 160,
|
|
||||||
|
|
||||||
-- Plate reader rear lock/unlock Key
|
|
||||||
-- The default small keyboard key to lock/unlock the rear plate reader is 164 (4 - INPUT_SELECT_WEAPON_HEAVY)
|
|
||||||
plate_rear_lock = 164
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Here you can change the default values for the operator menu, do note, if any of these values are not
|
-- Here you can change the default values for the operator menu, do note, if any of these values are not
|
||||||
|
|||||||
Reference in New Issue
Block a user