Skip to content

Instantly share code, notes, and snippets.

@Sainan
Last active November 10, 2023 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sainan/25e55a5d50e683a73c2bf70693d5491a to your computer and use it in GitHub Desktop.
Save Sainan/25e55a5d50e683a73c2bf70693d5491a to your computer and use it in GitHub Desktop.
util.require_natives("2944b")
local cur_note = nil
util.create_tick_handler(function()
PAD.DISABLE_CONTROL_ACTION(0, 0, true) -- Disable INPUT_NEXT_CAMERA (V)
PAD.DISABLE_CONTROL_ACTION(0, 79, true) -- Disable INPUT_VEH_LOOK_BEHIND (C)
local note = nil
if util.is_key_down('Z') then -- C4
note = 16
elseif util.is_key_down('X') then -- D4
note = 17
elseif util.is_key_down('C') then -- E4
note = 18
elseif util.is_key_down('V') then -- F4
note = 19
elseif util.is_key_down('B') then -- G4
note = 20
elseif util.is_key_down('N') then -- A4
note = 21
elseif util.is_key_down('M') then -- B4
note = 22
elseif util.is_key_down(0xBC) then -- C5
note = 23
end
if cur_note and note ~= cur_note then
cur_note = nil
elseif note ~= nil then
cur_note = note
VEHICLE.SET_VEHICLE_MOD(entities.get_user_vehicle_as_handle(), 14, note)
PAD.SET_CONTROL_VALUE_NEXT_FRAME(0, 86, 1)
end
end)
@Sainan
Copy link
Author

Sainan commented Nov 7, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment