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.

34 lines
773 B
C++
Raw Normal View History

2021-05-26 13:33:26 +02:00
#include "backend/looped/looped.hpp"
#include "pointers.hpp"
#include "natives.hpp"
#include "services/player_service.hpp"
2021-05-26 13:33:26 +02:00
namespace big
{
static bool bReset = true;
2021-05-26 13:33:26 +02:00
void looped::player_specate()
{
if (g_player_service->m_selected_player == nullptr || !g_player_service->m_selected_player->is_valid() || !g.player.spectating)
{
if (g.player.spectating) g.player.spectating = false;
2021-05-26 13:33:26 +02:00
if (!bReset)
{
bReset = true;
2021-05-26 13:33:26 +02:00
g_pointers->m_spectate_player(false, -1);
HUD::SET_MINIMAP_IN_SPECTATOR_MODE(false, -1);
}
return;
}
Ped target = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player_service->m_selected_player->id());
g_pointers->m_spectate_player(true, target);
HUD::SET_MINIMAP_IN_SPECTATOR_MODE(true, target);
bReset = false;
2021-05-26 13:33:26 +02:00
}
}