From 6a9c4ee1e290c7d9a4f1822e92d71b03e8e62d13 Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Fri, 4 Jun 2021 19:20:47 +0600 Subject: [PATCH] Fix startup crash --- CheatMenu/CheatMenu.cpp | 10 +++++++++- CheatMenu/MenuInfo.h | 2 +- CheatMenu/Visual.cpp | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CheatMenu/CheatMenu.cpp b/CheatMenu/CheatMenu.cpp index 1e6f384..249dc30 100644 --- a/CheatMenu/CheatMenu.cpp +++ b/CheatMenu/CheatMenu.cpp @@ -163,8 +163,16 @@ void CheatMenu::ApplyStyle() void MenuThread(void* param) { + static bool game_init = false; + // Wait till the game is initialized - Sleep(3000); + Events::processScriptsEvent += [] + { + game_init = true; + }; + + while (!game_init) + Sleep(1000); if (GetModuleHandle("SAMP.dll")) { diff --git a/CheatMenu/MenuInfo.h b/CheatMenu/MenuInfo.h index 0c902d5..e003ee5 100644 --- a/CheatMenu/MenuInfo.h +++ b/CheatMenu/MenuInfo.h @@ -2,5 +2,5 @@ #define MENU_NAME "Cheat Menu" #define MENU_VERSION_NUMBER "2.7" #define MENU_VERSION MENU_VERSION_NUMBER"-beta" -#define BUILD_NUMBER "20210522" +#define BUILD_NUMBER "20210604" #define MENU_TITLE MENU_NAME " v" MENU_VERSION "(" BUILD_NUMBER ")" \ No newline at end of file diff --git a/CheatMenu/Visual.cpp b/CheatMenu/Visual.cpp index 5e6e09a..ed7eebc 100644 --- a/CheatMenu/Visual.cpp +++ b/CheatMenu/Visual.cpp @@ -284,6 +284,8 @@ void Visual::Draw() if (ImGui::BeginChild("VisualsChild")) { + ImGui::TextWrapped("These options won't work if you got any mods that drastically changes the game hud. i.e. Mobile Hud, GTA 5 Hud etc."); + ImGui::Spacing(); Ui::ColorPickerAddress("Armourbar color", *(int*)0x5890FC, ImVec4(180, 25, 29, 255)); Ui::EditAddress("Armourbar posX ", 0x866B78, -999, 94, 999); Ui::EditAddress("Armourbar posY ", 0x862D38, -999, 48, 999);