feat: remote clear wanted level and remote never wanted (#93)

This commit is contained in:
Maddy 2022-03-08 13:26:28 -05:00 committed by GitHub
parent 1fcfd5e0c6
commit 9503ab4fdb
6 changed files with 43 additions and 1 deletions

View File

@ -47,6 +47,7 @@ namespace big
QUEUE_JOB_BEGIN_CLAUSE()
{
looped::player_never_wanted();
looped::player_specate();
}QUEUE_JOB_END_CLAUSE

View File

@ -10,6 +10,7 @@ namespace big
static void tunables_disable_phone();
static void tunables_no_idle_kick();
static void player_never_wanted();
static void player_specate();
static void protections_replay_interface();

View File

@ -0,0 +1,14 @@
#include "backend/looped/looped.hpp"
#include "services/player_service.hpp"
#include "util/toxic.hpp"
namespace big
{
void looped::player_never_wanted()
{
if (g->player.player_never_wanted && g_player_service->get_selected()->is_valid())
{
toxic::clear_wanted_player(g_player_service->get_selected()->id());
}
}
}

View File

@ -23,6 +23,7 @@ namespace big
struct player {
int character_slot = 1;
bool player_never_wanted = false;
int set_level = 130;
bool spectating = false;
};

View File

@ -44,4 +44,16 @@ namespace big::toxic
g_pointers->m_trigger_script_event(1, args, arg_count, -1);
}
}
inline void clear_wanted_player(Player target)
{
constexpr size_t arg_count = 3;
int64_t args[arg_count] = {
(int)eRemoteEvent::ClearWantedLevel,
0,
*script_global(1893548).at(target, 600).at(511).as<int*>()
};
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << target);
}
}

View File

@ -14,6 +14,19 @@ namespace big
ImGui::Text(title.c_str());
ImGui::Checkbox("Spectate", &g->player.spectating);
if (ImGui::TreeNode("Misc")) {
components::button("Clear Wanted Level", [] {
toxic::clear_wanted_player(g_player_service->get_selected()->id());
});
ImGui::SameLine();
ImGui::Checkbox("Never Wanted", &g->player.player_never_wanted);
ImGui::TreePop();
}
if (g_player_service->get_selected()->is_valid())
{