.:HyPeX:. Posted March 25, 2014 Posted March 25, 2014 Well, Engineer does not work but all the rest work perfectly.. cant see why, they're all perfect!! function DeployMetClick(button, state) if state == "up" then return end local CursorX, CursorY = getCursorPosition() if CursorX > 0.79 and CursorY > 0.917 then if CursorX < 0.96 and CursorY < 0.96 then Deploy() outputConsole("DEPLOYED") end end if CursorX > 0.00600 and CursorY > 0.809 then if CursorX < 0.07050 and CursorY < 0.898 then setElementData(getLocalPlayer(), "Class", "Medic") outputConsole("Medic") end end if CursorX > 0.07426 and CursorY > 0.8098 then if CursorX < 0.01367 and CursorY < 0.8971 then setElementData(getLocalPlayer(), "Class", "Engineer") outputConsole("Engineer") end end if CursorX > 0.14100 and CursorY > 0.809 then if CursorX < 0.20400 and CursorY < 0.898 then setElementData(getLocalPlayer(), "Class", "Assault") outputConsole("Assault") end end if CursorX > 0.20800 and CursorY > 0.809 then if CursorX < 0.27100 and CursorY < 0.898 then setElementData(getLocalPlayer(), "Class", "Sniper") outputConsole("Sniper") end end end addEventHandler("onClientClick", getRootElement(), DeployMetClick) My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
Moderators IIYAMA Posted March 25, 2014 Moderators Posted March 25, 2014 if CursorX [color=#0040FF]>[/color] [color=#FF0000]0.07426[/color] and CursorY > 0.8098 then if CursorX [color=#0040FF]<[/color] [color=#FF0000]0.01367[/color] and CursorY < 0.8971 then setElementData(getLocalPlayer(), "Class", "Engineer") outputConsole("Engineer") end end Take a closed look at that. It must be higher then 0.07426 and lower then 0.01367, which isn't possible. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
.:HyPeX:. Posted March 25, 2014 Author Posted March 25, 2014 if CursorX [color=#0040FF]>[/color] [color=#FF0000]0.07426[/color] and CursorY > 0.8098 then if CursorX [color=#0040FF]<[/color] [color=#FF0000]0.01367[/color] and CursorY < 0.8971 then setElementData(getLocalPlayer(), "Class", "Engineer") outputConsole("Engineer") end end Take a closed look at that. It must be higher then 0.07426 and lower then 0.01367, which isn't possible. i got the values directly from my ingame function wich returns mouse X:Y, i'll check again.. EDIT: Got it, there's an extra 0, it should be 0.1367, not 0.01367. My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
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