feat(Player): Added spectate_player
This commit is contained in:
parent
bb9d95525d
commit
45158dcf14
@ -21,6 +21,11 @@ namespace big
|
|||||||
looped::self_no_ragdoll();
|
looped::self_no_ragdoll();
|
||||||
}QUEUE_JOB_END_CLAUSE
|
}QUEUE_JOB_END_CLAUSE
|
||||||
|
|
||||||
|
QUEUE_JOB_BEGIN_CLAUSE()
|
||||||
|
{
|
||||||
|
looped::player_specate();
|
||||||
|
}QUEUE_JOB_END_CLAUSE
|
||||||
|
|
||||||
QUEUE_JOB_BEGIN_CLAUSE()
|
QUEUE_JOB_BEGIN_CLAUSE()
|
||||||
{
|
{
|
||||||
looped::self_noclip();
|
looped::self_noclip();
|
||||||
|
@ -5,6 +5,8 @@ namespace big
|
|||||||
{
|
{
|
||||||
class looped {
|
class looped {
|
||||||
public:
|
public:
|
||||||
|
static void player_specate();
|
||||||
|
|
||||||
static void self_godmode();
|
static void self_godmode();
|
||||||
static void self_off_radar();
|
static void self_off_radar();
|
||||||
static void self_noclip();
|
static void self_noclip();
|
||||||
|
19
BigBaseV2/src/backend/looped/player/spectate.cpp
Normal file
19
BigBaseV2/src/backend/looped/player/spectate.cpp
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#include "backend/looped/looped.hpp"
|
||||||
|
#include "pointers.hpp"
|
||||||
|
#include "natives.hpp"
|
||||||
|
|
||||||
|
namespace big
|
||||||
|
{
|
||||||
|
static Ped spectated_ped = -1;
|
||||||
|
static bool bLastSpectating = false;
|
||||||
|
|
||||||
|
void looped::player_specate()
|
||||||
|
{
|
||||||
|
Ped player = PLAYER::GET_PLAYER_PED(g.selected_player.id);
|
||||||
|
|
||||||
|
if (player != spectated_ped || (!bLastSpectating && bLastSpectating != g.player.spectating))
|
||||||
|
g_pointers->m_spectate_player(g.player.spectating, player);
|
||||||
|
|
||||||
|
bLastSpectating = g.player.spectating;
|
||||||
|
}
|
||||||
|
}
|
@ -17,6 +17,7 @@ namespace big
|
|||||||
{
|
{
|
||||||
// if (!g.players[i].is_online) // tell user player joined
|
// if (!g.players[i].is_online) // tell user player joined
|
||||||
|
|
||||||
|
g.players[i].id = i;
|
||||||
g.players[i].is_online = true;
|
g.players[i].is_online = true;
|
||||||
|
|
||||||
int iNetworkHandle[26];
|
int iNetworkHandle[26];
|
||||||
|
@ -7,6 +7,7 @@ namespace big
|
|||||||
{
|
{
|
||||||
struct CPlayer
|
struct CPlayer
|
||||||
{
|
{
|
||||||
|
int32_t id;
|
||||||
char name[20];
|
char name[20];
|
||||||
|
|
||||||
bool is_friend = false;
|
bool is_friend = false;
|
||||||
|
@ -33,4 +33,6 @@ namespace big::functions
|
|||||||
);
|
);
|
||||||
using send_event_ack = void(rage::netEventMgr* event_manager, CNetGamePlayer* source_player, CNetGamePlayer* target_player, int event_index, int event_handled_bitset);
|
using send_event_ack = void(rage::netEventMgr* event_manager, CNetGamePlayer* source_player, CNetGamePlayer* target_player, int event_index, int event_handled_bitset);
|
||||||
// Received Event Signatures END
|
// Received Event Signatures END
|
||||||
|
|
||||||
|
using spectate_player = bool(bool toggle, Ped player);
|
||||||
}
|
}
|
||||||
|
@ -167,6 +167,11 @@ namespace big
|
|||||||
memset(spectator_check, 0x90, 0x4);
|
memset(spectator_check, 0x90, 0x4);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
main_batch.add("Spectate Player", "48 89 5C 24 ? 57 48 83 EC 20 41 8A F8 84 C9", [this](memory::handle ptr)
|
||||||
|
{
|
||||||
|
m_spectate_player = ptr.as<decltype(m_spectate_player)>();
|
||||||
|
});
|
||||||
|
|
||||||
main_batch.run(memory::module(nullptr));
|
main_batch.run(memory::module(nullptr));
|
||||||
|
|
||||||
m_hwnd = FindWindowW(L"grcWindow", nullptr);
|
m_hwnd = FindWindowW(L"grcWindow", nullptr);
|
||||||
|
@ -56,6 +56,8 @@ namespace big
|
|||||||
functions::received_event* m_received_event{};
|
functions::received_event* m_received_event{};
|
||||||
functions::send_event_ack* m_send_event_ack{};
|
functions::send_event_ack* m_send_event_ack{};
|
||||||
// Received Event Signatures END
|
// Received Event Signatures END
|
||||||
|
|
||||||
|
functions::spectate_player* m_spectate_player{};
|
||||||
};
|
};
|
||||||
|
|
||||||
inline pointers *g_pointers{};
|
inline pointers *g_pointers{};
|
||||||
|
Reference in New Issue
Block a user