healLV Posted November 21, 2016 Posted November 21, 2016 Hello. So I have this problem: I bind arrow keys to 4 different function but only one appear to be working and only adds to y. What am I doing wrong? local screenWidth,screenHeight = guiGetScreenSize() local y = 150 local x = 8 function replace() local playerWeapon = getPedWeapon(localPlayer) if playerWeapon == 30 or playerWeapon == 31 then if getControlState("aim_weapon") then dxDrawImage ( screenWidth/2 + x, screenHeight/2 - y, 100, 100, "crosshair.png") end end end addEventHandler("onClientRender", root, replace) function hminus() y = y - 1 end function hplus() y = y + 1 end function wminus() x = x - 1 end function wplus() x = x + 1 end function outputchatbox() outputChatBox("elseif screenWidth == "..x.." and screenHeight == "..y.." then") end function bindkey() bindKey("arrow_d", "down", hminus) bindKey("arrow_u", "down", hminus) bindKey("arrow_l", "down", hminus) bindKey("arrow_r", "down", hminus) bindKey("m", "down", outputchatbox) end addEventHandler("onClientResourceStart", root, bindkey)
Dzsozi (h03) Posted November 21, 2016 Posted November 21, 2016 Are you sure that you want to bind hminus function to every key? 2
healLV Posted November 21, 2016 Author Posted November 21, 2016 1 hour ago, Dzsozi said: Are you sure that you want to bind hminus function to every key? oh lol how stupid I am. I should have checked things after copying. Well thanks for spotting it for me ;D -TC 2
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