Minor fixes

This commit is contained in:
Grinch_ 2022-02-20 23:00:35 +06:00
parent 9991064107
commit 3dd96c020f
3 changed files with 40 additions and 26 deletions

View File

@ -5,9 +5,21 @@
void MenuThread(void* param) 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 Had to put this in place since some people put the folder in root
directory and the asi in modloader. Why?? directory and the asi in modloader. Why??
@ -15,7 +27,7 @@ void MenuThread(void* param)
if (!std::filesystem::is_directory(PLUGIN_PATH((char*)"CheatMenu"))) 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; 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; return;
} }
@ -26,7 +38,7 @@ void MenuThread(void* param)
if (!GetModuleHandle(BY_GAME("SilentPatchSA.asi","SilentPatchVC.asi","SilentPatchIII.asi"))) 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; 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) if (msgID == IDOK)
{ {
@ -43,7 +55,7 @@ void MenuThread(void* param)
if (GetModuleHandle("SAMP.dll") || GetModuleHandle("SAMP.asi")) if (GetModuleHandle("SAMP.dll") || GetModuleHandle("SAMP.asi"))
{ {
gLog << "Error: CheatMenu doesn't support SAMP" << std::endl; 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; return;
} }
CFastman92limitAdjuster::Init(); CFastman92limitAdjuster::Init();
@ -51,7 +63,7 @@ void MenuThread(void* param)
if (GetModuleHandle("vcmp-proxy.dll") || GetModuleHandle("vcmp-proxy.asi")) if (GetModuleHandle("vcmp-proxy.dll") || GetModuleHandle("vcmp-proxy.asi"))
{ {
gLog << "Error: CheatMenu doesn't support VCMP" << std::endl; 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; return;
} }
#endif #endif

View File

@ -88,6 +88,7 @@ Vehicle::Vehicle()
pVeh->m_nFlags.bFireProof = true; pVeh->m_nFlags.bFireProof = true;
pVeh->m_nFlags.bCollisionProof = true; pVeh->m_nFlags.bCollisionProof = true;
pVeh->m_nFlags.bMeleeProof = true; pVeh->m_nFlags.bMeleeProof = true;
pVeh->m_nFlags.bImmuneToNonPlayerDamage = true;
#else #else
pVeh->m_nEntityFlags.bBulletProof = true; pVeh->m_nEntityFlags.bBulletProof = true;
pVeh->m_nEntityFlags.bExplosionProof = true; pVeh->m_nEntityFlags.bExplosionProof = true;
@ -576,6 +577,7 @@ void Vehicle::ShowPage()
pVeh->m_nFlags.bFireProof = false; pVeh->m_nFlags.bFireProof = false;
pVeh->m_nFlags.bCollisionProof = false; pVeh->m_nFlags.bCollisionProof = false;
pVeh->m_nFlags.bMeleeProof = false; pVeh->m_nFlags.bMeleeProof = false;
pVeh->m_nFlags.bImmuneToNonPlayerDamage = false;
#else #else
pVeh->m_nEntityFlags.bBulletProof = false; pVeh->m_nEntityFlags.bBulletProof = false;
pVeh->m_nEntityFlags.bExplosionProof = false; pVeh->m_nEntityFlags.bExplosionProof = false;

View File

@ -574,33 +574,33 @@ void Visual::ShowPage()
{ {
{TEXT("Visual.NoOutline"), 0}, {TEXT("Visual.ThinOutline"), 1}, {TEXT("Visual.DefaultOutline"), 2} {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<Ui::NamedValue> style static std::vector<Ui::NamedValue> 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::EditRadioButtonAddressEx(TEXT("Visual.MoneyFontStyle"), 0x58F57F, style);
Ui::EditAddress<float>(TEXT("RadarHeight"), *(int*)0x5834F6, 0, 76, 999); Ui::EditAddress<float>(TEXT("Visual.RadarHeight"), *(int*)0x5834F6, 0, 76, 999);
Ui::EditAddress<float>(TEXT("RadarWidth"), *(int*)0x5834C2, 0, 94, 999); Ui::EditAddress<float>(TEXT("Visual.RadarWidth"), *(int*)0x5834C2, 0, 94, 999);
Ui::EditAddress<float>(TEXT("RadarPosX"), *(int*)0x5834D4, -999, 40, 999); Ui::EditAddress<float>(TEXT("Visual.RadarPosX"), *(int*)0x5834D4, -999, 40, 999);
Ui::EditAddress<float>(TEXT("RadarPosY"), *(int*)0x583500, -999, 104, 999); Ui::EditAddress<float>(TEXT("Visual.RadarPosY"), *(int*)0x583500, -999, 104, 999);
Ui::EditAddress<int>(TEXT("RadarZoom"), 0xA444A3, 0, 0, 170); Ui::EditAddress<int>(TEXT("Visual.RadarZoom"), 0xA444A3, 0, 0, 170);
Ui::ColorPickerAddress(TEXT("RadioStationColor"), 0xBAB24C, ImVec4(150, 150, 150, 255)); Ui::ColorPickerAddress(TEXT("Visual.RadioStationColor"), 0xBAB24C, ImVec4(150, 150, 150, 255));
static std::vector<Ui::NamedValue> star_border static std::vector<Ui::NamedValue> 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::EditRadioButtonAddressEx(TEXT("Visual.WantedStarBorder"), 0x58DD41, star_border);
Ui::EditAddress<float>(TEXT("WantedPosX"), *(int*)0x58DD0F, -999, 29, 999); Ui::EditAddress<float>(TEXT("Visual.WantedPosX"), *(int*)0x58DD0F, -999, 29, 999);
Ui::EditAddress<float>(TEXT("WantedPosY"), *(int*)0x58DDFC, -999, 114, 999); Ui::EditAddress<float>(TEXT("Visual.WantedPosY"), *(int*)0x58DDFC, -999, 114, 999);
Ui::EditAddress<float>(TEXT("WeaponAmmoPosX"), *(int*)0x58FA02, -999, 32, 999); Ui::EditAddress<float>(TEXT("Visual.WeaponAmmoPosX"), *(int*)0x58FA02, -999, 32, 999);
Ui::EditAddress<float>(TEXT("WeaponAmmoPosY"), *(int*)0x58F9E6, -999, 43, 999); Ui::EditAddress<float>(TEXT("Visual.WeaponAmmoPosY"), *(int*)0x58F9E6, -999, 43, 999);
Ui::EditAddress<float>(TEXT("WeaponIconPosX"), *(int*)0x58F927, -999, 32, 999); Ui::EditAddress<float>(TEXT("Visual.WeaponIconPosX"), *(int*)0x58F927, -999, 32, 999);
Ui::EditAddress<float>(TEXT("WeaponIconPosY"), *(int*)0x58F913, -999, 20, 999); Ui::EditAddress<float>(TEXT("Visual.WeaponIconPosY"), *(int*)0x58F913, -999, 20, 999);
#elif GTAVC #elif GTAVC
Ui::EditAddress<float>(TEXT("RadarPosX"), 0x68FD2C, -999, 40, 999); Ui::EditAddress<float>(TEXT("Visual.RadarPosX"), 0x68FD2C, -999, 40, 999);
Ui::EditAddress<float>(TEXT("RadarPosY"), 0x68FD34, -999, 104, 999); Ui::EditAddress<float>(TEXT("Visual.RadarPosY"), 0x68FD34, -999, 104, 999);
Ui::EditAddress<BYTE>(TEXT("RadarWidth"), 0x68FD28, -999, 20, 999); Ui::EditAddress<BYTE>(TEXT("Visual.RadarWidth"), 0x68FD28, -999, 20, 999);
#endif #endif
ImGui::EndChild(); ImGui::EndChild();