Krom Posted November 29, 2008 Posted November 29, 2008 Hello. There's such functon listed in MTA-Wiki, but an example is missed. Here's very common idea: when I scrool-up my wheel while keeping mouse at some GUI element (button if possible), I need some variable A to become A + 1, and when I scrool-down, A should become A - 1. If anyone ever saw that function working well, could you give me an example please? Thankyou!
Remp Posted November 29, 2008 Posted November 29, 2008 addEventHandler("onClientMouseWheel",getRootElement(),function(direction) if source==yourbutton then -- up if direction==1 then yourvariable = yourvariable + 1 outputChatBox("Variable increased by one, new value: "..yourvariable) -- down elseif direction==-1 then yourvariable = yourvariable - 1 outputChatBox("Variable decreased by one, new value: "..yourvariable) end 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