crazyde21 Posted February 28, 2014 Posted February 28, 2014 --I mean is: can i use ("lalt" key and "e" key) --to Trigger olther functions? . For example: i press ("lalt"+"E") --then outputChatBox("You just press \"lalt\"+\"E\"!!!") Use what Function? onClientKey bindKey --or what Function?who can give me an example?
iPrestege Posted February 28, 2014 Posted February 28, 2014 You can just use : onClientKey And check the pressed buttons.
Sasu Posted February 28, 2014 Posted February 28, 2014 See the example of getKeyState, that is what you want. State: Inactive
Dealman Posted February 28, 2014 Posted February 28, 2014 Example from my Radio resource; if((getKeyState("lshift") == true) and (getKeyState("r") == true)) and (isChatBoxInputActive() == false) and (isConsoleActive() == false) then If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
crazyde21 Posted March 5, 2014 Author Posted March 5, 2014 im ok , then my lua is function playerPressedKey(button, press) if not(press) and button=='lalt' then triggerEvent ( "uncallQ", root ) triggerEvent ( "uncallE", root ) end if (press) and button=='lalt' then triggerEvent ( "callQ", root ) triggerEvent ( "callE", root ) end end addEventHandler("onClientKey", root, playerPressedKey) and addEvent ( "callQ", true ) addEventHandler ( "callQ", root, function() bindKey ( "q", "down", bindQ ) end ) addEvent ( "uncallQ", true ) addEventHandler ( "uncallQ", root, function() unbindKey ( "q", "down", bindQ ) end ) function bindQ ( ) if ( guiGetVisible ( mission2.window[1] ) == true ) then guiSetVisible ( mission2.window[1], false ) showCursor( false ) else triggerServerEvent("checkzt",getLocalPlayer(),getLocalPlayer()) guiSetVisible ( mission2.window[1], true ) showCursor( true ) end end
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