hygkolk1 Posted June 26, 2016 Share Posted June 26, 2016 Hello, Sorry for 2 questions at once, I read the rules and did not read about asking two questions in a single post I have been looking for a native "command" to retrieve the value of the fuel gauge in a car, and set it to any value you want. In the game the fuel gauge is static and set to max but if you shoot the tank on for example a truck then it drops and your car will stop after the fuel gauge reaches 0. (so there are values set for it?) I have looked and crtl+f'd nativedb throughout, with no luck, other dashboard items like blinkers are available.. Also I am looking to improve the camera angles while driving, I would like to be able to for example look at my feet while driving But right now your view in first person is limited.. I was wondering if I could make a mod in Lua which checks to see if player is in car and if returned true then sets the camera rotation to greater values. Any idea's how to get fuel float & set max camera viewing angles? I know you guys have hate for newbie posters that think they are modders but I am seriously curious how one would take these problems thanks MrGTAmodsgerman 1 Link to comment Share on other sites More sharing options...
Jitnaught Posted June 26, 2016 Share Posted June 26, 2016 The fuel gauge would probably require memory editing. Link to comment Share on other sites More sharing options...
hygkolk1 Posted June 26, 2016 Author Share Posted June 26, 2016 The fuel gauge would probably require memory editing. So finding the address with lets say cheat engine? I know I can't handle a task like that, I would end up with 1 mil results since all i know it decreases by a fixed and then stops decreasing.. Link to comment Share on other sites More sharing options...
alloc8or Posted June 26, 2016 Share Posted June 26, 2016 The fuel gauge would probably require memory editing. So finding the address with lets say cheat engine? I know I can't handle a task like that, I would end up with 1 mil results since all i know it decreases by a fixed and then stops decreasing.. Easiest way for is probably ScriptHookV's getScriptHandleBaseAddress function and then: float fuel = *(float *)(CVehicle + (GAME_VERSION > 3 ? 0x768 : 0x758)); Link to comment Share on other sites More sharing options...
Jitnaught Posted June 26, 2016 Share Posted June 26, 2016 CVehicle is the base address? Is that working code for the fuel or just an example? Also is there any documentation online for GTA V memory addresses? Link to comment Share on other sites More sharing options...
hygkolk1 Posted June 26, 2016 Author Share Posted June 26, 2016 Unknown_Modder, I can not find any information about getScriptHandleBaseAddress nor what CVehicle is (and even why GAME_VERSION needs to be more than 3), thanks for your help but could you point me to where I can find some documentation on what you just posted? Jitnaught 1 Link to comment Share on other sites More sharing options...
alloc8or Posted June 26, 2016 Share Posted June 26, 2016 (edited) Unknown_Modder, I can not find any information about getScriptHandleBaseAddress nor what CVehicle is (and even why GAME_VERSION needs to be more than 3), thanks for your help but could you point me to where I can find some documentation on what you just posted? So here's a complete function (the simplest I could think of). ScriptHookV SDK is required: #define GAME_VERSION getGameVersion()float getFuel(Vehicle vehicle){ BYTE *address = getScriptHandleBaseAddress(vehicle); // CVehicle int offset = (GAME_VERSION > 3 ? 0x768 : 0x758); // offset changed in b372 return address == NULL ? 0.0f : *(float *)(address + offset); // return 0.0f if address is NULL} Do you understand now? EDIT: setFuel would be this: void setFuel(Vehicle vehicle, float value){ BYTE *address = getScriptHandleBaseAddress(vehicle); int offset = (GAME_VERSION > 3 ? 0x768 : 0x758); if (address) { *(float *)(address + offset) = value; }} Edited June 26, 2016 by Unknown_Modder Jitnaught and Skorpro 2 Link to comment Share on other sites More sharing options...
_CP_ Posted June 26, 2016 Share Posted June 26, 2016 Maybe this parameter from handling.meta will be helpful. <fPetrolTankVolume value="65.000000" /> Jitnaught 1 Link to comment Share on other sites More sharing options...
MrGTAmodsgerman Posted June 29, 2016 Share Posted June 29, 2016 (edited) Hello, Sorry for 2 questions at once, I read the rules and did not read about asking two questions in a single post I have been looking for a native "command" to retrieve the value of the fuel gauge in a car, and set it to any value you want. In the game the fuel gauge is static and set to max but if you shoot the tank on for example a truck then it drops and your car will stop after the fuel gauge reaches 0. (so there are values set for it?) I have looked and crtl+f'd nativedb throughout, with no luck, other dashboard items like blinkers are available.. Also I am looking to improve the camera angles while driving, I would like to be able to for example look at my feet while driving But right now your view in first person is limited.. I was wondering if I could make a mod in Lua which checks to see if player is in car and if returned true then sets the camera rotation to greater values. Any idea's how to get fuel float & set max camera viewing angles? I know you guys have hate for newbie posters that think they are modders but I am seriously curious how one would take these problems thanks I remember the time where i ask the same thing but everbody says "Its not possible" "You can only damage your petrol tank" I hope you get it to work! I cant wait, would be awesome to see a real petrol state of a mod inside my vehicle! Edited June 29, 2016 by MrGTAmodsgerman Link to comment Share on other sites More sharing options...
luckyma1990 Posted December 10, 2016 Share Posted December 10, 2016 Unknown_Modder, I can not find any information about getScriptHandleBaseAddress nor what CVehicle is (and even why GAME_VERSION needs to be more than 3), thanks for your help but could you point me to where I can find some documentation on what you just posted? So here's a complete function (the simplest I could think of). ScriptHookV SDK is required: #define GAME_VERSION getGameVersion()float getFuel(Vehicle vehicle){ BYTE *address = getScriptHandleBaseAddress(vehicle); // CVehicle int offset = (GAME_VERSION > 3 ? 0x768 : 0x758); // offset changed in b372 return address == NULL ? 0.0f : *(float *)(address + offset); // return 0.0f if address is NULL} Do you understand now? EDIT: setFuel would be this: void setFuel(Vehicle vehicle, float value){ BYTE *address = getScriptHandleBaseAddress(vehicle); int offset = (GAME_VERSION > 3 ? 0x768 : 0x758); if (address) { *(float *)(address + offset) = value; }} Hi Dear May I ask what is the expected return of getScriptHandleBaseAddress(Vehicle vehicle)? I'm trying to use the same routine to get the steer/throttle/brake value when game AI is driving. However, the return value of getScriptHandleBaseAddress(Vehicle vehicle) is 120, and the pointer is ffffffff8154d8s2 (16hex). I tried to serach the 16 hex value in CheatEngin but found nothing? Any advice on this? 1. Why I get scan error (no readable memory found) in Cheat Enging when search the address range [ffffffff8154d8s2, some larger value]? 2. Is ffffffff8154d8s2 a possibly right value or should it be 8154d8s2 instead? But if I search [8154d8s2, some larger value] it also returns a scan error message saying no readable memory found. 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