mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
feat: improved RedM support (#162)
* Improvements + remove redm keybind system as it's pointless
This commit is contained in:
@@ -74,32 +74,48 @@ local function startProgress(data)
|
||||
end
|
||||
|
||||
local disable = data.disable
|
||||
local isFivem = cache.game == 'fivem'
|
||||
local controls = {
|
||||
['INPUT_LOOK_LR'] = isFivem and 1 or 0xA987235F,
|
||||
['INPUT_LOOK_UD'] = isFivem and 2 or 0xD2047988,
|
||||
['INPUT_SPRINT'] = isFivem and 21 or 0x8FFC75D6,
|
||||
['INPUT_AIM'] = isFivem and 25 or 0xF84FA74F,
|
||||
['INPUT_MOVE_LR'] = isFivem and 30 or 0x4D8FB4C1,
|
||||
['INPUT_MOVE_UD'] = isFivem and 31 or 0xFDA83190,
|
||||
['INPUT_DUCK'] = isFivem and 36 or 0xDB096B85,
|
||||
['INPUT_VEH_MOVE_LEFT_ONLY'] = isFivem and 63 or 0x9DF54706,
|
||||
['INPUT_VEH_MOVE_RIGHT_ONLY'] = isFivem and 64 or 0x97A8FD98,
|
||||
['INPUT_VEH_ACCELERATE'] = isFivem and 71 or 0x5B9FD4E2,
|
||||
['INPUT_VEH_BRAKE'] = isFivem and 72 or 0x6E1F639B,
|
||||
['INPUT_VEH_EXIT'] = isFivem and 75 or 0xFEFAB9B4,
|
||||
['INPUT_VEH_MOUSE_CONTROL_OVERRIDE'] = isFivem and 106 or 0x39CCABD5
|
||||
}
|
||||
|
||||
while progress do
|
||||
if disable then
|
||||
if disable.mouse then
|
||||
DisableControlAction(0, 1, true)
|
||||
DisableControlAction(0, 2, true)
|
||||
DisableControlAction(0, 106, true)
|
||||
DisableControlAction(0, controls['INPUT_LOOK_LR'], true)
|
||||
DisableControlAction(0, controls['INPUT_LOOK_UD'], true)
|
||||
DisableControlAction(0, controls['INPUT_VEH_MOUSE_CONTROL_OVERRIDE'], true)
|
||||
end
|
||||
|
||||
if disable.move then
|
||||
DisableControlAction(0, 21, true)
|
||||
DisableControlAction(0, 30, true)
|
||||
DisableControlAction(0, 31, true)
|
||||
DisableControlAction(0, 36, true)
|
||||
DisableControlAction(0, controls['INPUT_SPRINT'], true)
|
||||
DisableControlAction(0, controls['INPUT_MOVE_LR'], true)
|
||||
DisableControlAction(0, controls['INPUT_MOVE_UD'], true)
|
||||
DisableControlAction(0, controls['INPUT_DUCK'], true)
|
||||
end
|
||||
|
||||
if disable.car then
|
||||
DisableControlAction(0, 63, true)
|
||||
DisableControlAction(0, 64, true)
|
||||
DisableControlAction(0, 71, true)
|
||||
DisableControlAction(0, 72, true)
|
||||
DisableControlAction(0, 75, true)
|
||||
DisableControlAction(0, controls['INPUT_VEH_MOVE_LEFT_ONLY'], true)
|
||||
DisableControlAction(0, controls['INPUT_VEH_MOVE_RIGHT_ONLY'], true)
|
||||
DisableControlAction(0, controls['INPUT_VEH_ACCELERATE'], true)
|
||||
DisableControlAction(0, controls['INPUT_VEH_BRAKE'], true)
|
||||
DisableControlAction(0, controls['INPUT_VEH_EXIT'], true)
|
||||
end
|
||||
|
||||
if disable.combat then
|
||||
DisableControlAction(0, 25, true)
|
||||
DisableControlAction(0, controls['INPUT_AIM'], true)
|
||||
DisablePlayerFiring(cache.playerId, true)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user