343 guilty spark Posted February 15, 2014 Share Posted February 15, 2014 (edited) [GAME: GTA SA] so i have this code (asi plugin) to make the car steer where the camera is pointed like halo CE and halo 2 vista and halo 3, and halo 4, and possibly halo 5 when it comes out. void run(){ running = true; float steer; DWORD pCar; // i know i can be a bike or a horse. while(running){ pCar = getCar(); if(playerDefined() && playerAlive() && pCar > 0 && keyToggoled(9) && !inMenu()){ steer = getDeltaAngle(getCameraAngle(), getFixedPlayerAngle()); steer = sinf(steer) * 1.2f; // x1.2 to steer faster if(steer < -STEER_LIMIT) steer = -STEER_LIMIT; if(steer > STEER_LIMIT) steer = STEER_LIMIT; *(float *) (pCar + 1172) = steer; //****** PROBLEM **********// Sleep(1); // sleep => wont work! i must reset faster than the game does. [email protected]#n it }else{ Sleep(500); } }} so i need a way to lock (pCar + 1172) where pCar is the car pointer, 1172 is the steering angle how can i do that? or do you know a better way? if so then why did you take all this time to tell me? WHY? to reduce cpu usage and make steering more efficient. (60 check per sec is good). (this mod was released under the name "Halo Driving Style" but it causes the fps to drop) Edited February 15, 2014 by 343 guilty spark Link to comment Share on other sites More sharing options...
fastman92 Posted February 16, 2014 Share Posted February 16, 2014 Use Cheat Engine to find what assembly instructions of GTA SA write to your memory addresses. NOP these addresses by 0x90 code with function in your plugin. Link to comment Share on other sites More sharing options...
Wesser Posted February 16, 2014 Share Posted February 16, 2014 (edited) You need to NOP 6 bytes at 0x006ADD22 and write DD D8 90 90 90 90 at 0x006ADD65 to prevent the game from updating the wheel steering angle for cars only. I advice you to learn the assembly language first and inject some code at these addresses rather than creating new threads which make your code desyncronized in relation to the execution of the one of the game. Note: you may also consider m_fRearSteerAngle at CVehicle + 0x0498 and add 180 degrees to it for 4-wheel steering vehicles (like the Monster). Edited February 16, 2014 by Wesser 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
343 guilty spark Posted February 16, 2014 Author Share Posted February 16, 2014 (edited) THANK YOU. i dont want to test if the player is driving a monster (i dont belive in monsters) or not, so CJ can kiss his eye! (if he can) i have no idea how does code injection work, can you give an example? EDIT. i tried it i works great with Sleep(100); thanks man! MOD (OPEN SOURCE, someone broke in an broke the door): http://www.gtagarage.com/mods/show.php?id=25226 Edited February 16, 2014 by 343 guilty spark 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