From 2158f52300f4118aeef49289e3fcd947ae66a49a Mon Sep 17 00:00:00 2001 From: Flohhhhh <48927090+Flohhhhh@users.noreply.github.com> Date: Sat, 9 Sep 2023 14:19:33 -0400 Subject: [PATCH] Disable controls when outside vehicle Fixes #16 --- ulc/client/c_buttons.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ulc/client/c_buttons.lua b/ulc/client/c_buttons.lua index 085cc79..b1eb52f 100644 --- a/ulc/client/c_buttons.lua +++ b/ulc/client/c_buttons.lua @@ -42,6 +42,8 @@ end) -- updates ui whenever extra is used in a button function ULC:SetStage(extra, action, playSound, extraOnly, repair, force) if not MyVehicle then print("[ULC:SetStage()] MyVehicle is not defined right now :/") return false end + -- could add a config switch to allow this later but that may cause issues + if not IsPedInAnyVehicle(PlayerPedId(), true) then print("[ULC:SetStage()] Player is not in a vehicle :/") return false end local newState --print("[ulc:SetStage]", extra, action, playSound, extraOnly)