Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
feat: configurable key for seatbelt
Browse files Browse the repository at this point in the history
  • Loading branch information
demxnn committed Feb 23, 2022
1 parent 573255c commit 21a4b36
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"stress": false,
"fuel": false,
"voice": false,
"seatbelt": false,
"seatbelt": {
"enabled": false,
"key": "B"
},
"circleMap": true,
"logo": true,
"refreshRates": {
Expand Down
4 changes: 2 additions & 2 deletions modules/seatbelt/client.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if cfg.seatbelt then
if cfg.seatbelt.enabled then
local isBuckled = false

local Buckled = function()
Expand Down Expand Up @@ -52,6 +52,6 @@ if cfg.seatbelt then
end
end, false)

RegisterKeyMapping('seatbelt', 'Toggle Seatbelt', 'keyboard', 'B')
RegisterKeyMapping('seatbelt', 'Toggle Seatbelt', 'keyboard', cfg.seatbelt.key)
TriggerEvent('chat:removeSuggestion', '/seatbelt')
end
2 changes: 1 addition & 1 deletion modules/seatbelt/server.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
if cfg.seatbelt then SetConvarReplicated('game_enableFlyThroughWindscreen', 'true') end
if cfg.seatbelt.enabled then SetConvarReplicated('game_enableFlyThroughWindscreen', 'true') end

0 comments on commit 21a4b36

Please sign in to comment.