diff --git a/resource/common/locale/English.json b/resource/common/locale/English.json index fad0148..e6e3393 100644 --- a/resource/common/locale/English.json +++ b/resource/common/locale/English.json @@ -233,6 +233,7 @@ "Fat": "Fat", "FireProof": "Fire proof", "FreeHealthcare": "Free healthcare", + "FreezeWL" : "Freeze wanted level", "GodDisabled": "God mode disabled", "GodEnabled": "God mode enabled", "GodMode": "God mode", diff --git a/src/player.cpp b/src/player.cpp index 6f2574d..ceb6a27 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -15,7 +15,6 @@ static inline void PlayerModelBrokenFix() Call<0x5A81E0>(0, pPlayer->m_pPlayerData->m_pPedClothesDesc, 0xBC1C78, false); } - /* Taken from gta chaos mod by Lordmau5 https://github.com/gta-chaos-mod/Trilogy-ASI-Script @@ -421,6 +420,29 @@ void Player::ShowPage() Ui::CheckboxAddress(TEXT("Player.FreeHealthcare"), BY_GAME((int)&pInfo->m_bFreeHealthCare, (int)&pInfo->m_bFreeHealthCare, (int)&pInfo->m_bGetOutOfHospitalFree)); + if (Ui::CheckboxWithHint(TEXT("Player.FreezeWL"), &m_bFreezeWantedLevel)) + { + static unsigned int chaosLvl; + if (m_bFreezeWantedLevel) + { +#ifdef GTASA + chaosLvl = pPlayer->GetWanted()->m_nChaosLevel; +#else + chaosLvl = pPlayer->m_pWanted->m_nChaosLevel; +#endif + patch::SetUChar(BY_GAME(0x561C90, 0x4D2110, 0x4AD900), 0xC3); + } + else + { +#ifdef GTASA + pPlayer->GetWanted()->m_nChaosLevel = chaosLvl; +#else + pPlayer->m_pWanted->m_nChaosLevel = chaosLvl; +#endif + patch::SetUChar(BY_GAME(0x561C90, 0x4D2110, 0x4AD900), BY_GAME(0x51, 0x8B, 0xA1)); + } + } + if (Ui::CheckboxWithHint(TEXT("Player.GodMode"), &m_bGodMode)) { #ifdef GTASA diff --git a/src/player.h b/src/player.h index b3ffc71..25ff22a 100644 --- a/src/player.h +++ b/src/player.h @@ -12,6 +12,7 @@ private: static inline bool m_bEnabled = false; static inline CVector m_fPos; }; + static inline bool m_bFreezeWantedLevel; #ifdef GTASA static inline bool m_bAimSkinChanger;