diff --git a/src/dllmain.cpp b/src/dllmain.cpp index 1be790c..adf6e9e 100644 --- a/src/dllmain.cpp +++ b/src/dllmain.cpp @@ -5,9 +5,21 @@ void MenuThread(void* param) { - // wait for game init - Sleep(3000); + /* + Wait for game init + // Sleep(3000); + Doing it like this doesn't prevent from attaching a debugger + */ + static bool gameStarted = false; + Events::processScriptsEvent +=[]{ + gameStarted = true; + }; + while (!gameStarted) + { + Sleep(500); + } + /* Had to put this in place since some people put the folder in root directory and the asi in modloader. Why?? @@ -15,7 +27,7 @@ void MenuThread(void* param) if (!std::filesystem::is_directory(PLUGIN_PATH((char*)"CheatMenu"))) { gLog << "Error: CheatMenu folder not found. You need to put both \"CheatMenu.asi\" & \"CheatMenu\" folder in the same directory" << std::endl; - MessageBox(RsGlobal.ps->window, "CheatMenu folder not found. You need to put both \"CheatMenu.asi\" & \"CheatMenu\" folder in the same directory", "CheatMenu", MB_ICONERROR); + MessageBox(NULL, "CheatMenu folder not found. You need to put both \"CheatMenu.asi\" & \"CheatMenu\" folder in the same directory", "CheatMenu", MB_ICONERROR); return; } @@ -26,7 +38,7 @@ void MenuThread(void* param) if (!GetModuleHandle(BY_GAME("SilentPatchSA.asi","SilentPatchVC.asi","SilentPatchIII.asi"))) { gLog << "Error: SilentPatch not found. Please install it from here https://gtaforums.com/topic/669045-silentpatch/" << std::endl; - int msgID = MessageBox(RsGlobal.ps->window, "SilentPatch not found. Do you want to install Silent Patch? (Game restart required)", "CheatMenu", MB_OKCANCEL | MB_DEFBUTTON1); + int msgID = MessageBox(NULL, "SilentPatch not found. Do you want to install Silent Patch? (Game restart required)", "CheatMenu", MB_OKCANCEL | MB_DEFBUTTON1); if (msgID == IDOK) { @@ -43,7 +55,7 @@ void MenuThread(void* param) if (GetModuleHandle("SAMP.dll") || GetModuleHandle("SAMP.asi")) { gLog << "Error: CheatMenu doesn't support SAMP" << std::endl; - MessageBox(RsGlobal.ps->window, "SAMP detected. Exiting CheatMenu.", "CheatMenu", MB_ICONERROR); + MessageBox(NULL, "SAMP detected. Exiting CheatMenu.", "CheatMenu", MB_ICONERROR); return; } CFastman92limitAdjuster::Init(); @@ -51,7 +63,7 @@ void MenuThread(void* param) if (GetModuleHandle("vcmp-proxy.dll") || GetModuleHandle("vcmp-proxy.asi")) { gLog << "Error: CheatMenu doesn't support VCMP" << std::endl; - MessageBox(RsGlobal.ps->window, "VCMP detected. Exiting CheatMenu.", "CheatMenu", MB_ICONERROR); + MessageBox(NULL, "VCMP detected. Exiting CheatMenu.", "CheatMenu", MB_ICONERROR); return; } #endif diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 893369f..5f56ba7 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -88,6 +88,7 @@ Vehicle::Vehicle() pVeh->m_nFlags.bFireProof = true; pVeh->m_nFlags.bCollisionProof = true; pVeh->m_nFlags.bMeleeProof = true; + pVeh->m_nFlags.bImmuneToNonPlayerDamage = true; #else pVeh->m_nEntityFlags.bBulletProof = true; pVeh->m_nEntityFlags.bExplosionProof = true; @@ -576,6 +577,7 @@ void Vehicle::ShowPage() pVeh->m_nFlags.bFireProof = false; pVeh->m_nFlags.bCollisionProof = false; pVeh->m_nFlags.bMeleeProof = false; + pVeh->m_nFlags.bImmuneToNonPlayerDamage = false; #else pVeh->m_nEntityFlags.bBulletProof = false; pVeh->m_nEntityFlags.bExplosionProof = false; diff --git a/src/visual.cpp b/src/visual.cpp index 32e065f..1978de9 100644 --- a/src/visual.cpp +++ b/src/visual.cpp @@ -574,33 +574,33 @@ void Visual::ShowPage() { {TEXT("Visual.NoOutline"), 0}, {TEXT("Visual.ThinOutline"), 1}, {TEXT("Visual.DefaultOutline"), 2} }; - Ui::EditRadioButtonAddressEx(TEXT("MoneyFontOutline"), 0x58F58D, font_outline); + Ui::EditRadioButtonAddressEx(TEXT("Visual.MoneyFontOutline"), 0x58F58D, font_outline); static std::vector style { - {TEXT("Style1"), 1}, {TEXT("Style2"), 2}, {TEXT("DefaultStyle"), 3} + {TEXT("Visual.Style1"), 1}, {TEXT("Visual.Style2"), 2}, {TEXT("Visual.DefaultStyle"), 3} }; - Ui::EditRadioButtonAddressEx(TEXT("MoneyFontStyle"), 0x58F57F, style); - Ui::EditAddress(TEXT("RadarHeight"), *(int*)0x5834F6, 0, 76, 999); - Ui::EditAddress(TEXT("RadarWidth"), *(int*)0x5834C2, 0, 94, 999); - Ui::EditAddress(TEXT("RadarPosX"), *(int*)0x5834D4, -999, 40, 999); - Ui::EditAddress(TEXT("RadarPosY"), *(int*)0x583500, -999, 104, 999); - Ui::EditAddress(TEXT("RadarZoom"), 0xA444A3, 0, 0, 170); - Ui::ColorPickerAddress(TEXT("RadioStationColor"), 0xBAB24C, ImVec4(150, 150, 150, 255)); + Ui::EditRadioButtonAddressEx(TEXT("Visual.MoneyFontStyle"), 0x58F57F, style); + Ui::EditAddress(TEXT("Visual.RadarHeight"), *(int*)0x5834F6, 0, 76, 999); + Ui::EditAddress(TEXT("Visual.RadarWidth"), *(int*)0x5834C2, 0, 94, 999); + Ui::EditAddress(TEXT("Visual.RadarPosX"), *(int*)0x5834D4, -999, 40, 999); + Ui::EditAddress(TEXT("Visual.RadarPosY"), *(int*)0x583500, -999, 104, 999); + Ui::EditAddress(TEXT("Visual.RadarZoom"), 0xA444A3, 0, 0, 170); + Ui::ColorPickerAddress(TEXT("Visual.RadioStationColor"), 0xBAB24C, ImVec4(150, 150, 150, 255)); static std::vector star_border { - {TEXT("NoBorder"), 0}, {TEXT("DefaultBorder"), 1}, {TEXT("BoldBorder"), 2} + {TEXT("Visual.NoBorder"), 0}, {TEXT("Visual.DefaultBorder"), 1}, {TEXT("Visual.BoldBorder"), 2} }; - Ui::EditRadioButtonAddressEx(TEXT("WantedStarBorder"), 0x58DD41, star_border); - Ui::EditAddress(TEXT("WantedPosX"), *(int*)0x58DD0F, -999, 29, 999); - Ui::EditAddress(TEXT("WantedPosY"), *(int*)0x58DDFC, -999, 114, 999); - Ui::EditAddress(TEXT("WeaponAmmoPosX"), *(int*)0x58FA02, -999, 32, 999); - Ui::EditAddress(TEXT("WeaponAmmoPosY"), *(int*)0x58F9E6, -999, 43, 999); - Ui::EditAddress(TEXT("WeaponIconPosX"), *(int*)0x58F927, -999, 32, 999); - Ui::EditAddress(TEXT("WeaponIconPosY"), *(int*)0x58F913, -999, 20, 999); + Ui::EditRadioButtonAddressEx(TEXT("Visual.WantedStarBorder"), 0x58DD41, star_border); + Ui::EditAddress(TEXT("Visual.WantedPosX"), *(int*)0x58DD0F, -999, 29, 999); + Ui::EditAddress(TEXT("Visual.WantedPosY"), *(int*)0x58DDFC, -999, 114, 999); + Ui::EditAddress(TEXT("Visual.WeaponAmmoPosX"), *(int*)0x58FA02, -999, 32, 999); + Ui::EditAddress(TEXT("Visual.WeaponAmmoPosY"), *(int*)0x58F9E6, -999, 43, 999); + Ui::EditAddress(TEXT("Visual.WeaponIconPosX"), *(int*)0x58F927, -999, 32, 999); + Ui::EditAddress(TEXT("Visual.WeaponIconPosY"), *(int*)0x58F913, -999, 20, 999); #elif GTAVC - Ui::EditAddress(TEXT("RadarPosX"), 0x68FD2C, -999, 40, 999); - Ui::EditAddress(TEXT("RadarPosY"), 0x68FD34, -999, 104, 999); - Ui::EditAddress(TEXT("RadarWidth"), 0x68FD28, -999, 20, 999); + Ui::EditAddress(TEXT("Visual.RadarPosX"), 0x68FD2C, -999, 40, 999); + Ui::EditAddress(TEXT("Visual.RadarPosY"), 0x68FD34, -999, 104, 999); + Ui::EditAddress(TEXT("Visual.RadarWidth"), 0x68FD28, -999, 20, 999); #endif ImGui::EndChild();