HeresOtis Posted March 9, 2012 Share Posted March 9, 2012 How to check if a key is pressed using memory address? I found this but don't understand. How do I check if F6 is pressed? :LABELwait 00A8D: [email protected] = read_memory 0x00969110 size 4 virtual_protect 0if04A4: [email protected] == 0x434F4445 // Hex String 'CODE'jf @LABEL0A8C: write_memory 0x00969110 size 4 value 0 virtual_protect 0 // Clear buffer Link to comment Share on other sites More sharing options...
Link2012 Posted March 9, 2012 Share Posted March 9, 2012 0x969110 is the cheat pool, is where the cheat string is located (Is used to check if a cheat was typed) So 0x969110 method only works with characteres that goes to Cheat string (A-Z,1-9, that basic) Why just don't use the CLEO 0AB0 for check F6? anyway CLEO 0AB0 opcode uses the windows func (SHORT __stdcall GetKeyState(int nVirtKey)) at 0x0081E64C in 1.0US Link to comment Share on other sites More sharing options...
Ashwin.Star Posted March 9, 2012 Share Posted March 9, 2012 (edited) i was wrong, Sorry! Edited March 9, 2012 by Ashwin the new boy Link to comment Share on other sites More sharing options...
Link2012 Posted March 9, 2012 Share Posted March 9, 2012 there are many way of doing that,one of them is to read only one byte of it, & check if it is equals to 117 :0wait 00A8D: [email protected] = read_memory 0x969110 size 1 virtual_protect [email protected] == 117jf @00A8C: write_memory 0x969110 size 4 value 0 virtual_protect 0jump @0 i will work only if the last key pressed was F6, you may add 1 to mem add for previous key check, Cheat string only stores ASCII Characteres for checking cheats, not virtual keys like F6. Link to comment Share on other sites More sharing options...
HeresOtis Posted March 9, 2012 Author Share Posted March 9, 2012 I'm modding the main.scm so I can't use cleo opcodes. I need to find a way to use F6 as a keypress. Link to comment Share on other sites More sharing options...
Ashwin.Star Posted March 9, 2012 Share Posted March 9, 2012 cleo opcodes are not only for cleo scripts, once you installed cleo mod, you can use them in main.scm also, Link to comment Share on other sites More sharing options...
HeresOtis Posted March 9, 2012 Author Share Posted March 9, 2012 But I don't want to use it for my mod. I want it to be CLEO-independent. Link to comment Share on other sites More sharing options...
Ashwin.Star Posted March 9, 2012 Share Posted March 9, 2012 this may be difficult then, Link to comment Share on other sites More sharing options...
HeresOtis Posted March 9, 2012 Author Share Posted March 9, 2012 I found this posted by Seeman. It's easy and works perfect. http://www.gtaforums.com/index.php?showtop...dpost&p=4082258 Link to comment Share on other sites More sharing options...
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