Lunatic (01-20-2016),swwrgaersghaedrgedrgherdhg (05-26-2017)
From now on post your source code snippets here, don't post full bases/menu's. This is just for code snippets.
Format:
Name of cheat
Code Snippet (use tags)
GodMode
Code:if (PLAYER_GODMODE == true) { PLAYER::SET_PLAYER_INVINCIBLE(PLAYER, true); PED::CLEAR_PED_BLOOD_DAMAGE(PLAYER_PED); PED::RESET_PED_VISIBLE_DAMAGE(PLAYER_PED); } if (PLAYER_GODMODE == false) { PLAYER::SET_PLAYER_INVINCIBLE(PLAYER, false); }
Last edited by ZectixV1; 01-10-2016 at 02:47 AM.
Threads:
Resignation
🚀 GTA: V 1.40 | Mod Menu Mega Thread Revamped | Info Thread 🚀
Joined - 10-27-2014
Donated - 3-6-2015
Minion
GTAV Minion - 10-12-2015
CoD Minion - 12-23-2015
Resigned - 07-17-2016
Lunatic (01-20-2016),swwrgaersghaedrgedrgherdhg (05-26-2017)
Clear Wanted Level:
Code:void ClearWantedLevel(Player player) { PLAYER::CLEAR_PLAYER_WANTED_LEVEL(player); }
-part of Team Matrix
Ptr class to make reading/writing memory easier:
Custom AOB ScannerCode:#include <windows.h> #include <initializer_list> #define naked __declspec(naked) struct Ptr { DWORD64 pointer; explicit Ptr(DWORD64 ptr, std::initializer_list<DWORD64> offsets = {}) : pointer(ptr) { for each (DWORD64 offset in offsets) { pointer = *reinterpret_cast<DWORD64*>(pointer); pointer += offset; } } template <typename T> T get(DWORD64 offset = 0) { return *reinterpret_cast<T*>(pointer + offset); } template <typename T> void set(T value, DWORD64 offset = 0) { *reinterpret_cast<T*>(pointer + offset) = value; } void nop(DWORD64 length) const { for (int i = 0; i < length; ++i) { *reinterpret_cast<BYTE*>(pointer + i) = 0x90; // nop } } };
Get Tunable PointerCode:#include <windows.h> #include <Psapi.h> #include <string> #include <vector> #include <sstream> #include <cassert> DWORD64 AOBScan(DWORD64 begin, DWORD64 end, std::string pattern) { struct PByte { byte byte; bool ignore; }; std::vector<PByte> patterns; std::stringstream ss; ss << pattern; std::string sByte; while (ss >> sByte) { if (sByte == "?" || sByte == "??") { patterns.push_back({ NULL, true }); } else { int iByte = stoi(sByte, nullptr, 16); assert(iByte >= 0 && iByte <= 255); patterns.push_back({ byte(iByte), false }); } } for (DWORD64 i = begin; i < end - DWORD64(patterns.size()); ++i) { bool success = true; for (DWORD64 j = 0; j < DWORD64(patterns.size()); ++j) { byte memByte = *reinterpret_cast<byte*>(i + j); PByte pByte = patterns[j]; if (memByte != pByte.byte && !pByte.ignore) { success = false; break; } } if (success) { return i; } } return NULL; } DWORD64 AOBScan(MODULEINFO moduleInfo, std::string pattern) { DWORD64 begin = DWORD64(moduleInfo.lpBaseOfDll); DWORD64 end = begin + DWORD64(moduleInfo.SizeOfImage); return AOBScan(begin, end, pattern); }
Get/Set TunablesCode:Ptr TunablesPointer() { DWORD64 base = DWORD64(g_MainModuleInfo.lpBaseOfDll); int patternResult = *reinterpret_cast<int*>(AOBScan(g_MainModuleInfo, "48 8B 8C C2 ? ? ? ? 48 85 C9 74 19") + 4); return Ptr(base + patternResult + 8, { 16 }); }
Code:template <typename T> void SetTunable(int index, T value) { static Ptr tunablesPointer = TunablesPointer(); return tunablesPointer.set(value, index * 8); } template <typename T> T GetTunable(int index) { static Ptr tunablesPointer = TunablesPointer(); return tunablesPointer.get<T>(index * 8); }
Last edited by TGWW$Twhwrhwhw4ryhrh; 01-12-2016 at 04:39 AM.
FabulousT3rm1n4t0r (06-17-2019)
Can you please help me adding this to a source based on scripthookv injection (ENT), I tried to use your Brick's Menu source as an example but I failed, of course... I just want to add the snow tunable to the trainer
Nothing happens when enabling the option in game
Last edited by afx01; 02-26-2016 at 10:49 PM.
Explosive ammo, make sure to call it inside your loop:
Code:SET_EXPLOSIVE_AMMO_THIS_FRAME(playerhandle);
Max Vehicle
Code:void Max_veh(Vehicle VehicleHandle) { SET_VEHICLE_FIXED(VehicleHandle); SET_VEHICLE_DEFORMATION_FIXED(VehicleHandle); SET_VEHICLE_DIRT_LEVEL(VehicleHandle, 0); SET_VEHICLE_TYRES_CAN_BURST(VehicleHandle, 0); SET_VEHICLE_WHEELS_CAN_BREAK(VehicleHandle, 0); SET_VEHICLE_HAS_STRONG_AXLES(VehicleHandle, 1); SET_VEHICLE_MOD_KIT(VehicleHandle, 0); SET_VEHICLE_CUSTOM_SECONDARY_COLOUR(VehicleHandle, rand() % 255, rand() % 255, rand() % 255); SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(VehicleHandle, rand() % 255, rand() % 255, rand() % 255); TOGGLE_VEHICLE_MOD(VehicleHandle, 18, 1); TOGGLE_VEHICLE_MOD(VehicleHandle, 22, 1); SET_VEHICLE_MOD(VehicleHandle, 16, 5, 0); SET_VEHICLE_MOD(VehicleHandle, 12, 2, 0); SET_VEHICLE_MOD(VehicleHandle, 11, 3, 0); SET_VEHICLE_MOD(VehicleHandle, 14, 14, 0); SET_VEHICLE_MOD(VehicleHandle, 15, 3, 0); SET_VEHICLE_MOD(VehicleHandle, 13, 2, 0); SET_VEHICLE_WHEEL_TYPE(VehicleHandle, 6); SET_VEHICLE_WINDOW_TINT(VehicleHandle, 1); SET_VEHICLE_MOD(VehicleHandle, 23, 14, 2); SET_VEHICLE_MOD(VehicleHandle, 0, 1, 0); SET_VEHICLE_MOD(VehicleHandle, 1, 1, 0); SET_VEHICLE_MOD(VehicleHandle, 2, 1, 0); SET_VEHICLE_MOD(VehicleHandle, 3, 1, 0); SET_VEHICLE_MOD(VehicleHandle, 4, 1, 0); SET_VEHICLE_MOD(VehicleHandle, 5, 1, 0); SET_VEHICLE_MOD(VehicleHandle, 6, 1, 0); SET_VEHICLE_MOD(VehicleHandle, 7, 1, 0); SET_VEHICLE_MOD(VehicleHandle, 8, 1, 0); SET_VEHICLE_MOD(VehicleHandle, 9, 1, 0); SET_VEHICLE_MOD(VehicleHandle, 10, 1, 0); _SET_VEHICLE_NEON_LIGHT_ENABLED(VehicleHandle, 0, 1); _SET_VEHICLE_NEON_LIGHT_ENABLED(VehicleHandle, 1, 1); _SET_VEHICLE_NEON_LIGHT_ENABLED(VehicleHandle, 2, 1); _SET_VEHICLE_NEON_LIGHT_ENABLED(VehicleHandle, 3, 1); _SET_VEHICLE_NEON_LIGHTS_COLOUR(VehicleHandle, rand() % 255, rand() % 255, rand() % 255); SET_VEHICLE_NUMBER_PLATE_TEXT_INDEX(VehicleHandle, PLATE_YELLOWONBLACK); SET_VEHICLE_NUMBER_PLATE_TEXT(VehicleHandle, "MPGH"); }
Put This In Your Other Loop
Put This Is Your Submenu OptionsCode:if(godmode[0]){ PLAYER::SET_PLAYER_INVINCIBLE(PLAYER, true); PED::CLEAR_PED_BLOOD_DAMAGE(PLAYER_PED); PED::RESET_PED_VISIBLE_DAMAGE(PLAYER_PED); } else{ PLAYER::SET_PLAYER_INVINCIBLE(PLAYER, false); }
Put This In Your SwitchCode:addBoolOption("GodMode", &godmode[0]);
Put This Near The Top Of Your FileCode:case 1: if (!godmode[0]){ drawNotification("GodMode ~r~Disabled"); } else{ drawNotification("GodMode ~g~Enabled"); } break;
Use the checkboxes in bool arrays, looks cleanerCode:bool godmode[50];
Last edited by PhucedMODZ; 01-12-2018 at 11:45 AM. Reason: Wrote it on my phone, so adding the [code] bb tags to it
ZectixV1 (01-14-2018)