Jump to content

BindKey


yToPzz

Recommended Posts

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 by yToPzz
Link to comment
  • yToPzz changed the title to BindKey
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 1
Link to comment
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 by yToPzz
Link to comment
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
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)

 

spacer.png

Link to comment

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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...