AMARANT Posted January 25, 2014 Posted January 25, 2014 Is there any way to reverse controls in MTA? I mean replace "forwards" bind with "backwards" bind temporarily, etc.
AMARANT Posted January 25, 2014 Author Posted January 25, 2014 When I tried to set control enabled with setControlState, my player was always running. Controls "forwards" and "backwards" work like that, unfortunately. But I need them to be pressed just once. Like you press "W" or "S" on your keyboard.
Moderators IIYAMA Posted January 25, 2014 Moderators Posted January 25, 2014 Try something like this. toggleControl("forwards",false) toggleControl("backwards",false) local converterToBoolean = {["down"]=false,["up"]=true} local controlManagement = function (key,state) setControlState(key,converterToBoolean[state]) end bindKey("forwards","both",controlManagement) bindKey("backwards","both",controlManagement) 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
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