From 7057088c1f701b8602bf34bd077a16567b2ac3a3 Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Thu, 7 Jul 2022 02:23:32 +0600 Subject: [PATCH] Bug fixes, teleport with jetpack --- resource/CheatMenuSA/data/components.toml | 3 +++ resource/CheatMenuSA/data/vehicles.toml | 3 +++ src/menu.cpp | 2 +- src/teleport.cpp | 17 ++++++++++++++++- src/teleport.h | 1 + 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 resource/CheatMenuSA/data/components.toml create mode 100644 resource/CheatMenuSA/data/vehicles.toml diff --git a/resource/CheatMenuSA/data/components.toml b/resource/CheatMenuSA/data/components.toml new file mode 100644 index 0000000..bf75dc9 --- /dev/null +++ b/resource/CheatMenuSA/data/components.toml @@ -0,0 +1,3 @@ +############################################################################## +# Vehicle Tune Favoirites +############################################################################## \ No newline at end of file diff --git a/resource/CheatMenuSA/data/vehicles.toml b/resource/CheatMenuSA/data/vehicles.toml new file mode 100644 index 0000000..878d991 --- /dev/null +++ b/resource/CheatMenuSA/data/vehicles.toml @@ -0,0 +1,3 @@ +############################################################################## +# Vehicle Favoirites +############################################################################## \ No newline at end of file diff --git a/src/menu.cpp b/src/menu.cpp index 02ae0ad..4a4b566 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -22,7 +22,7 @@ void Menu::Init() Overlay::bLocName = gConfig.Get("Overlay.ShowLocationName", false); Overlay::bTransparent = gConfig.Get("Overlay.Transparent", false); Overlay::bMemUsage = gConfig.Get("Overlay.ShowMemoryUsage", false); - Overlay::bVehHealth = gConfig.Get("Overlay.ShowVehicleName", false); + Overlay::bVehHealth = gConfig.Get("Overlay.ShowVehicleHealth", false); Overlay::bVehSpeed = gConfig.Get("Overlay.ShowVehicleSpeed", false); Overlay::mSelectedPos = (DisplayPos)gConfig.Get("Overlay.SelectedPosition", (int)DisplayPos::BOTTOM_RIGHT); Overlay::fPosX = gConfig.Get("Overlay.PosX", 0); diff --git a/src/teleport.cpp b/src/teleport.cpp index 69a45b0..47a5419 100644 --- a/src/teleport.cpp +++ b/src/teleport.cpp @@ -41,7 +41,7 @@ void Teleport::Init() Events::processScriptsEvent += [] { - if ((TPMarker::m_bEnabled == true) && ((CTimer::m_snTimeInMilliseconds - TPMarker::m_nTimer) > 500)) + if ((TPMarker::m_bEnabled == true) && ((CTimer::m_snTimeInMilliseconds - TPMarker::m_nTimer) > 50)) { CPlayerPed* player = FindPlayerPed(); @@ -63,6 +63,12 @@ void Teleport::Init() { BY_GAME(player->Teleport(TPMarker::m_fPos, false), player->Teleport(TPMarker::m_fPos), player->Teleport(TPMarker::m_fPos)); } +#ifdef GTASA + if (TPMarker::m_bJetpack) + { + Command(CPools::GetPedRef(player)); + } +#endif TPMarker::m_bEnabled = false; Command(CPools::GetPedRef(player), false); @@ -126,8 +132,10 @@ void Teleport::TeleportPlayer(bool get_marker, CVector pos, int interior_id) { CPlayerPed* pPlayer = FindPlayerPed(); CVehicle* pVeh = pPlayer->m_pVehicle; + int hplayer = CPools::GetPedRef(pPlayer); #ifdef GTASA + TPMarker::m_bJetpack = Command(0); if (get_marker) { tRadarTrace targetBlip = CRadar::ms_RadarTrace[LOWORD(FrontEndMenuManager.m_nTargetBlipIndex)]; @@ -147,6 +155,8 @@ void Teleport::TeleportPlayer(bool get_marker, CVector pos, int interior_id) TheCamera.Fade(0, 0); Command(CPools::GetPedRef(pPlayer), true); } + + #endif #ifdef GTA3 @@ -194,6 +204,11 @@ void Teleport::TeleportPlayer(bool get_marker, CVector pos, int interior_id) { pPlayer->Teleport(pos, false); } + + if (TPMarker::m_bJetpack) + { + Command(hplayer); + } #else if (pVeh && pPlayer->m_pVehicle) { diff --git a/src/teleport.h b/src/teleport.h index 15aa662..8898403 100644 --- a/src/teleport.h +++ b/src/teleport.h @@ -16,6 +16,7 @@ private: static inline bool m_bEnabled; static inline CVector m_fPos = { -1, -1, -1 }; static inline uint m_nTimer; + static inline bool m_bJetpack; }; #ifdef GTASA