SparkMyte Posted September 18, 2021 Posted September 18, 2021 Hello! I am wondering how I can create a script where on a key press, I can make an event happen, such as 'L' to unlock/lock a vehicle and more. I am on C#. Thanks for reading and possibly helping!
sparx Posted September 19, 2021 Posted September 19, 2021 (edited) Use mp.keys.bind as listed here: https://wiki.rage.mp/index.php?title=Key::bind It also has a good example of calling a server-side event, where you can handle the locking and unlocking of a vehicle. Alternatively, if you're going sole c# there's a few scripts on the resources list that help. Edited September 19, 2021 by sparx
LT.Steiner Posted September 27, 2021 Posted September 27, 2021 Hi, Thank to @sparx for reply as C#. and as JS, use this form of script: /// This form you can get input of your keybind, 0x4C is "L", you can change it to your own key code everything you want. mp.keys.bind(0x4C, true, function() { /// Here write your code as you wish }); Finally, use this hyper link to find the key code you want 1
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