From f50d0f2c9d2ca4c6161a7b2af4f4afd6613ccc67 Mon Sep 17 00:00:00 2001 From: DayibBaba <79384354+DayibBaba@users.noreply.github.com> Date: Tue, 19 Mar 2024 20:10:33 +0100 Subject: [PATCH] Fixed bounty button & added bounty to all (#2846) * Added separate ID for Set button & Added bounty for all * Reverted unrelated changes CPlayerExtendedGameStateNode should be updated on classes repo though --- src/util/troll.hpp | 1 - src/views/network/view_network.cpp | 10 ++++++++++ src/views/players/player/player_toxic.cpp | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/util/troll.hpp b/src/util/troll.hpp index ca6e4ffb..3bea902c 100644 --- a/src/util/troll.hpp +++ b/src/util/troll.hpp @@ -36,5 +36,4 @@ namespace big::troll g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, -1, (int)eRemoteEvent::Bounty); } - } diff --git a/src/views/network/view_network.cpp b/src/views/network/view_network.cpp index b895e672..5314be36 100644 --- a/src/views/network/view_network.cpp +++ b/src/views/network/view_network.cpp @@ -9,6 +9,7 @@ #include "util/scripts.hpp" #include "util/session.hpp" #include "util/toxic.hpp" +#include "util/troll.hpp" #include "views/view.hpp" #include "backend/bool_command.hpp" @@ -401,6 +402,15 @@ namespace big toxic::start_activity(plyr.second, eActivityType::GunrunningDefend); }); }); + ImGui::SeparatorText("Bounty"); + static int value = 10000; + ImGui::SliderInt("##bountyvalue", &value, 0, 10000); + components::command_checkbox<"anonbounty">(); + components::button("Bounty All", [] { + g_player_service->iterate([](auto& plyr) { + troll::set_bounty_on_player(plyr.second, value, g.session.anonymous_bounty); + }); + }); }, false, "GRIEFING"_T.data()); diff --git a/src/views/players/player/player_toxic.cpp b/src/views/players/player/player_toxic.cpp index 0b70fb7c..f7361dbe 100644 --- a/src/views/players/player/player_toxic.cpp +++ b/src/views/players/player/player_toxic.cpp @@ -112,11 +112,11 @@ namespace big components::command_checkbox<"anonbounty">(); ImGui::SameLine(); - + ImGui::PushID("setbounty"); components::button("SET"_T, [] { troll::set_bounty_on_player(g_player_service->get_selected(), bounty_value, g.session.anonymous_bounty); }); - + ImGui::PopID(); ImGui::EndListBox(); } ImGui::EndGroup();