yToPzz Posted August 7, 2022 Share Posted August 7, 2022 (edited) I want to change the function to bindkey how do I? VEHICLE_SETTINGS = false addCommandHandler("steer", function() if VEHICLE_SETTINGS == false then openVehicleSettings() VEHICLE_SETTINGS = true else closeVehicleSettings() VEHICLE_SETTINGS = false end end) Edited August 7, 2022 by yToPzz Link to comment
#\_oskar_/# Posted August 7, 2022 Share Posted August 7, 2022 VEHICLE_SETTINGS = false addCommandHandler("steer", function() if VEHICLE_SETTINGS == false then openVehicleSettings() VEHICLE_SETTINGS = true else closeVehicleSettings() VEHICLE_SETTINGS = false end end) bindKey( "x", "down", "steer" ) or VEHICLE_SETTINGS = false bindKey( "x", "down", function() if VEHICLE_SETTINGS == false then openVehicleSettings() VEHICLE_SETTINGS = true else closeVehicleSettings() VEHICLE_SETTINGS = false end end) 1 Link to comment
yToPzz Posted August 7, 2022 Author Share Posted August 7, 2022 (edited) 4 hours ago, #\_oskar_/# said: VEHICLE_SETTINGS = false addCommandHandler("steer", function() if VEHICLE_SETTINGS == false then openVehicleSettings() VEHICLE_SETTINGS = true else closeVehicleSettings() VEHICLE_SETTINGS = false end end) bindKey( "x", "down", "steer" ) or VEHICLE_SETTINGS = false bindKey( "x", "down", function() if VEHICLE_SETTINGS == false then openVehicleSettings() VEHICLE_SETTINGS = true else closeVehicleSettings() VEHICLE_SETTINGS = false end end) thanks, but there is a problem if you open the panel without being in a vehicle the panel does not close is there a way to make the panel open only when in a car? Edited August 7, 2022 by yToPzz Link to comment
#\_oskar_/# Posted August 7, 2022 Share Posted August 7, 2022 34 minutes ago, yToPzz said: thanks, but there is a problem if you open the panel without being in a vehicle the panel does not close is there a way to make the panel open only when in a car? if isPedInVehicle ( localPlayer ) and VEHICLE_SETTINGS == false then Link to comment
yToPzz Posted August 7, 2022 Author Share Posted August 7, 2022 6 minutes ago, #\_oskar_/# said: if isPedInVehicle ( localPlayer ) and VEHICLE_SETTINGS == false then did not work : / Link to comment
#\_oskar_/# Posted August 7, 2022 Share Posted August 7, 2022 35 minutes ago, yToPzz said: did not work : / He is working VEHICLE_SETTINGS = false bindKey( "x", "down", function() if isPedInVehicle ( localPlayer ) and VEHICLE_SETTINGS == false then openVehicleSettings() VEHICLE_SETTINGS = true else closeVehicleSettings() VEHICLE_SETTINGS = false end end) Link to comment
yToPzz Posted August 7, 2022 Author Share Posted August 7, 2022 2 hours ago, #\_oskar_/# said: He is working VEHICLE_SETTINGS = false bindKey( "x", "down", function() if isPedInVehicle ( localPlayer ) and VEHICLE_SETTINGS == false then openVehicleSettings() VEHICLE_SETTINGS = true else closeVehicleSettings() VEHICLE_SETTINGS = false end end) Link to comment
#\_oskar_/# Posted August 8, 2022 Share Posted August 8, 2022 You have to add it with the window open this is an example window = guiCreateWindow(0.33, 0.35, 0.34, 0.31, "Test", true) VEHICLE_SETTINGS = false bindKey( "x", "down", function() if isPedInVehicle ( localPlayer ) and VEHICLE_SETTINGS == false then guiSetVisible( window, true) showCursor( true ) VEHICLE_SETTINGS = true else guiSetVisible( window,false) showCursor( false ) VEHICLE_SETTINGS = false end end) Link to comment
yToPzz Posted August 8, 2022 Author Share Posted August 8, 2022 10 hours ago, #\_oskar_/# said: You have to add it with the window open this is an example window = guiCreateWindow(0.33, 0.35, 0.34, 0.31, "Test", true) VEHICLE_SETTINGS = false bindKey( "x", "down", function() if isPedInVehicle ( localPlayer ) and VEHICLE_SETTINGS == false then guiSetVisible( window, true) showCursor( true ) VEHICLE_SETTINGS = true else guiSetVisible( window,false) showCursor( false ) VEHICLE_SETTINGS = false end end) Do I have to configure the positions of the functions? eg level, closing option etc? Link to comment
#\_oskar_/# Posted August 8, 2022 Share Posted August 8, 2022 4 hours ago, yToPzz said: Do I have to configure the positions of the functions? eg level, closing option etc? yes 1 Link to comment
yToPzz Posted August 9, 2022 Author Share Posted August 9, 2022 (edited) On 08/08/2022 at 12:39, #\_oskar_/# said: yes I got it, thank you Edited August 9, 2022 by yToPzz Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now