diff --git a/locales/en.json b/locales/en.json index b0db574..df401bb 100644 --- a/locales/en.json +++ b/locales/en.json @@ -6,7 +6,9 @@ "deleted_recording": "Deleted Recording!", "later_aligator": "Later aligator!", "stress_gain": "Feeling More Stressed!", - "no_vehicle_nearby": "No Vehicle Nearby For Flipping." + "no_vehicle_nearby": "No Vehicle Nearby For Flipping.", + "is_handcuffed": "You are handcuffed.", + "is_fastened": "You wear a seat belt." }, "success": { "cruise_control_enabled": "Cruise control enabled", @@ -30,7 +32,8 @@ }, "info": { "minutes": "minutes", - "seconds": "seconds.." + "seconds": "seconds..", + "shuffleSeat": "Shuffle seat" }, "actions": { "push_vehicle": "Press [~g~SHIFT~w~] and [~g~E~w~] to push the vehicle until [~g~SHIFT~w~] release", diff --git a/qbx_noshuff/client.lua b/qbx_noshuff/client.lua index e16fd75..68f0f25 100644 --- a/qbx_noshuff/client.lua +++ b/qbx_noshuff/client.lua @@ -1,3 +1,5 @@ +local config = lib.loadJson('qbx_noshuff.config') + ---Disables auto seat switching ---@param seatIndex number local function disableAutoShuffle(seatIndex) @@ -12,6 +14,14 @@ lib.onCache('seat', disableAutoShuffle) ---Makes the player ped shuffle to the next vehicle seat. local function shuffleSeat(self) + if QBX.PlayerData.metadata.ishandcuffed then + return exports.qbx_core:Notify(locale('error.is_handcuffed'), 'error') + end + + if LocalPlayer.state.seatbelt then + return exports.qbx_core:Notify(locale('error.is_fastened'), 'error') + end + self:disable(true) if cache.vehicle and cache.seat then TaskShuffleToNextVehicleSeat(cache.ped, cache.vehicle) @@ -24,7 +34,7 @@ end lib.addKeybind({ name = 'shuffleSeat', - description = '', - defaultKey = 'O', + description = locale('info.shuffleSeat'), + defaultKey = config.shuffleSeatKey, onPressed = shuffleSeat }) diff --git a/qbx_noshuff/config.json b/qbx_noshuff/config.json new file mode 100644 index 0000000..5bf3f2f --- /dev/null +++ b/qbx_noshuff/config.json @@ -0,0 +1,3 @@ +{ + "shuffleSeatKey": "O" +}