diff --git a/src/backend/looped/hud/hud_disable_input.cpp b/src/backend/looped/hud/hud_disable_input.cpp index b89df382..3fff99b7 100644 --- a/src/backend/looped/hud/hud_disable_input.cpp +++ b/src/backend/looped/hud/hud_disable_input.cpp @@ -10,5 +10,6 @@ namespace big PAD::DISABLE_ALL_CONTROL_ACTIONS(0); g.self.hud.typing--; } + g.settings.hotkeys.is_mp_chat_active = HUD::IS_MP_TEXT_CHAT_TYPING(); } } \ No newline at end of file diff --git a/src/core/settings.hpp b/src/core/settings.hpp index 57884b42..b5fee2a8 100644 --- a/src/core/settings.hpp +++ b/src/core/settings.hpp @@ -435,6 +435,7 @@ namespace big struct hotkeys { bool editing_menu_toggle = false; + std::atomic is_mp_chat_active; int menu_toggle = VK_INSERT; int teleport_waypoint = 0; int teleport_objective = 0; diff --git a/src/native_hooks/all_scripts.hpp b/src/native_hooks/all_scripts.hpp index 603b96dd..c83d7eb8 100644 --- a/src/native_hooks/all_scripts.hpp +++ b/src/native_hooks/all_scripts.hpp @@ -144,6 +144,18 @@ namespace big NETWORK::NETWORK_OVERRIDE_CLOCK_TIME(src->get_arg(0), src->get_arg(1), src->get_arg(2)); } + void SET_ENTITY_HEALTH(rage::scrNativeCallContext* src) + { + Entity entity = src->get_arg(0); + int health = src->get_arg(1); + int p2 = src->get_arg(2); + + if (g.self.god_mode && entity == self::ped) + health = ENTITY::GET_ENTITY_MAX_HEALTH(entity); + + ENTITY::SET_ENTITY_HEALTH(entity, health, p2); + } + void RETURN_TRUE(rage::scrNativeCallContext* src) { src->set_return_value(TRUE); diff --git a/src/native_hooks/carmod_shop.hpp b/src/native_hooks/carmod_shop.hpp index a2c30c15..942f2f0a 100644 --- a/src/native_hooks/carmod_shop.hpp +++ b/src/native_hooks/carmod_shop.hpp @@ -46,9 +46,6 @@ namespace big case RAGE_JOAAT("MP1_AWD_FMRALLYWONNAV"): case RAGE_JOAAT("MP1_AWD_FMWINSEARACE"): case RAGE_JOAAT("MP1_AWD_FMWINAIRRACE"): *out = 1; break; - case RAGE_JOAAT("SP0_TOTAL_CASH"): - case RAGE_JOAAT("SP1_TOTAL_CASH"): - case RAGE_JOAAT("SP2_TOTAL_CASH"): *out = 999999; break; default: src->set_return_value(STATS::STAT_GET_INT(hash, out, src->get_arg(2))); break; } } diff --git a/src/native_hooks/native_hooks.cpp b/src/native_hooks/native_hooks.cpp index 53a8dac3..63a313fc 100644 --- a/src/native_hooks/native_hooks.cpp +++ b/src/native_hooks/native_hooks.cpp @@ -114,6 +114,7 @@ namespace big add_native_detour(0xEB354E5376BC81A7, all_scripts::HUD_FORCE_WEAPON_WHEEL); add_native_detour(0x158C16F5E4CF41F8, all_scripts::RETURN_TRUE); // bypass casino country restrictions add_native_detour(0xE679E3E06E363892, all_scripts::NETWORK_OVERRIDE_CLOCK_TIME); + add_native_detour(0x6B76DC1F3AE6E6A3, all_scripts::SET_ENTITY_HEALTH); add_native_detour(0x40EB1EFD921822BC, all_scripts::DO_NOTHING); // SECURITY::REGISTER_SCRIPT_VARIABLE add_native_detour(0x340A36A700E99699, all_scripts::DO_NOTHING); // SECURITY::UNREGISTER_SCRIPT_VARIABLE add_native_detour(0x8E580AB902917360, all_scripts::DO_NOTHING); // SECURITY::FORCE_CHECK_SCRIPT_VARIABLES diff --git a/src/services/hotkey/hotkey_service.cpp b/src/services/hotkey/hotkey_service.cpp index 5dad36d5..124b428b 100644 --- a/src/services/hotkey/hotkey_service.cpp +++ b/src/services/hotkey/hotkey_service.cpp @@ -88,7 +88,17 @@ namespace big if (g.cmd_executor.enabled) return; - if (g_gui->is_open() || *g_pointers->m_gta.m_is_social_club_overlay_active || SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH(RAGE_JOAAT("cellphone_flashhand")) > 0 || HUD::IS_MP_TEXT_CHAT_TYPING()) + bool is_using_cellphone = false; + for (auto script : *g_pointers->m_gta.m_script_threads) + { + if (script && script->m_script_hash == RAGE_JOAAT("cellphone_flashhand")) + { + is_using_cellphone = script->m_context.m_state == rage::eThreadState::running; + } + } + + if (g_gui->is_open() || *g_pointers->m_gta.m_is_social_club_overlay_active || is_using_cellphone + || g.settings.hotkeys.is_mp_chat_active) return; if (state == eKeyState::RELEASE || state == eKeyState::DOWN)