Jump to content

hide window temporary


JeViCo

Recommended Posts

Hello everyone! What's wrong here?

function mouse_move(button, state, player)
	local veh = getPedOccupiedVehicle(localPlayer)
	if veh and getVehicleController(veh) == localPlayer and guiGetVisible(mywindow) then
		if state == "down" then
      --this part works
			outputChatBox("Button was pressed")
			guiSetVisible(mywindow, false)
			showCursor(false)
      --this part doesn't work
		elseif state == "up" then
			outputChatBox("Button was released")
			guiSetVisible(mywindow, true)
			showCursor(true)
		end
	end
end
addEventHandler("onClientKey", root, mouse_move)
bindKey("mouse2","both",mouse_move)

 

Edited by Juuve
Link to comment
addEventHandler("onClientKey", root, function(button, press, release)
	local veh = getPedOccupiedVehicle(localPlayer)
	if veh and getVehicleController(veh) == localPlayer and guiGetVisible(mywindow) then
		if (press) and button == "mouse2" then
			outputChatBox("Button was pressed")
			guiSetVisible(mywindow, false)
			showCursor(false)
		elseif (release) and button == "mouse2" then
			outputChatBox("Button was released")
			guiSetVisible(mywindow, true)
			showCursor(true)--]]
		end
	end
end
)

same thing with this

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