Bug fixes, teleport with jetpack

This commit is contained in:
Grinch_ 2022-07-07 02:23:32 +06:00
parent 2d7ffb089b
commit 7057088c1f
5 changed files with 24 additions and 2 deletions

View File

@ -0,0 +1,3 @@
##############################################################################
# Vehicle Tune Favoirites
##############################################################################

View File

@ -0,0 +1,3 @@
##############################################################################
# Vehicle Favoirites
##############################################################################

View File

@ -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);

View File

@ -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<Commands::TASK_JETPACK>(CPools::GetPedRef(player));
}
#endif
TPMarker::m_bEnabled = false;
Command<Commands::FREEZE_CHAR_POSITION_AND_DONT_LOAD_COLLISION>(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<Commands::IS_PLAYER_USING_JETPACK>(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<Commands::FREEZE_CHAR_POSITION_AND_DONT_LOAD_COLLISION>(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<Commands::TASK_JETPACK>(hplayer);
}
#else
if (pVeh && pPlayer->m_pVehicle)
{

View File

@ -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