This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/BigBaseV2/src/features/looped/util/spectate_player.cpp

29 lines
537 B
C++
Raw Normal View History

#include "features/util.hpp"
#include "pointers.hpp"
#include "natives.hpp"
namespace big
{
2021-01-10 16:19:40 +01:00
static bool bReset = true;
void util::spectate_player()
{
if (g_selectedPlayer.id == -1 || !g_selectedPlayer.is_online || !g_temp.is_spectating)
{
if (g_temp.is_spectating) g_temp.is_spectating = false;
2021-01-10 16:19:40 +01:00
if (!bReset)
{
bReset = true;
g_pointers->m_spectate_player(false, -1);
}
return;
}
g_pointers->m_spectate_player(true, PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_selectedPlayer.id));
2021-01-10 16:19:40 +01:00
bReset = false;
}
}