hdrtop Posted April 26, 2020 Posted April 26, 2020 (edited) Hello, I'm trying to create key binds, following this: https://wiki.rage.mp/index.php?title=Key::bind In clientside, I have this (client_packages/index.js) // Key F2 Press mp.keys.bind(0x71, true, function() { mp.events.callRemote('keypress:F4'); // Calling server event "keypress:F2" mp.gui.chat.push('F2 key is pressed.'); }); This shows the message "F2 key is pressed" on the chat. Serverside I have this (packages/index.js) mp.events.add("keypress:F2", (player) => { player.outputChatBox("Server response: OK"); }); But this is not working, like it's not calling the event. Anyone knows why it's happening? I've tried everything and nothing it's working... Edited April 26, 2020 by hdrtop
Fragrus Posted April 26, 2020 Posted April 26, 2020 You are calling the wrong event on the client-side. replace mp.events.callRemote('keypress:F4'); to mp.events.callRemote('keypress:F2');
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