JeViCo Posted February 11, 2018 Share Posted February 11, 2018 (edited) 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 February 11, 2018 by Juuve Link to comment
JeViCo Posted February 11, 2018 Author Share Posted February 11, 2018 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
JeViCo Posted February 11, 2018 Author Share Posted February 11, 2018 never mind, fixed here: 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