mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-17 23:07:26 +08:00
Add anonymous bounty toggle (#823)
Co-authored-by: tupoy-ya <72797377+tupoy-ya@users.noreply.github.com>
This commit is contained in:
parent
32f8ae890d
commit
f9e36693f1
@ -1,4 +1,5 @@
|
|||||||
#include "backend/player_command.hpp"
|
#include "backend/player_command.hpp"
|
||||||
|
#include "backend/bool_command.hpp"
|
||||||
#include "natives.hpp"
|
#include "natives.hpp"
|
||||||
#include "pointers.hpp"
|
#include "pointers.hpp"
|
||||||
#include "util/troll.hpp"
|
#include "util/troll.hpp"
|
||||||
@ -11,9 +12,10 @@ namespace big
|
|||||||
|
|
||||||
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
|
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
|
||||||
{
|
{
|
||||||
troll::set_bounty_on_player(player, 10000);
|
troll::set_bounty_on_player(player, 10000, g.session.anonymous_bounty);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
set_bounty g_bounty("bounty", "Bounty", "Sets a 10k bounty on the player", 0);
|
set_bounty g_bounty("bounty", "Bounty", "Sets a 10k bounty on the player", 0);
|
||||||
}
|
bool_command g_anonymous_bounty("anonbounty", "Anonymous Bounty", "Don't show your name when setting a bounty on someone", g.session.anonymous_bounty);
|
||||||
|
}
|
||||||
|
@ -332,6 +332,7 @@ namespace big
|
|||||||
bool wanted_level_all = false;
|
bool wanted_level_all = false;
|
||||||
|
|
||||||
bool show_cheating_message = false;
|
bool show_cheating_message = false;
|
||||||
|
bool anonymous_bounty = true;
|
||||||
|
|
||||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(session,
|
NLOHMANN_DEFINE_TYPE_INTRUSIVE(session,
|
||||||
local_weather, override_time, override_weather, custom_time, disable_chat_filter, log_chat_messages,
|
local_weather, override_time, override_weather, custom_time, disable_chat_filter, log_chat_messages,
|
||||||
@ -339,7 +340,7 @@ namespace big
|
|||||||
player_magnet_count, is_team, name_spoof_enabled, advertise_menu, spoofed_name, join_in_sctv_slots,
|
player_magnet_count, is_team, name_spoof_enabled, advertise_menu, spoofed_name, join_in_sctv_slots,
|
||||||
kick_chat_spammers, kick_host_when_forcing_host, explosion_karma, damage_karma, disable_traffic,
|
kick_chat_spammers, kick_host_when_forcing_host, explosion_karma, damage_karma, disable_traffic,
|
||||||
disable_peds, force_thunder, block_ceo_money, randomize_ceo_colors, send_to_apartment_idx, send_to_warehouse_idx,
|
disable_peds, force_thunder, block_ceo_money, randomize_ceo_colors, send_to_apartment_idx, send_to_warehouse_idx,
|
||||||
chat_commands, chat_command_default_access_level, show_cheating_message)
|
chat_commands, chat_command_default_access_level, show_cheating_message, anonymous_bounty)
|
||||||
} session{};
|
} session{};
|
||||||
|
|
||||||
struct settings
|
struct settings
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
namespace big::troll
|
namespace big::troll
|
||||||
{
|
{
|
||||||
inline void set_bounty_on_player(player_ptr target, int value)
|
inline void set_bounty_on_player(player_ptr target, int value, bool anonymous)
|
||||||
{
|
{
|
||||||
const size_t arg_count = 22;
|
const size_t arg_count = 22;
|
||||||
int64_t args[arg_count] =
|
int64_t args[arg_count] =
|
||||||
@ -17,7 +17,7 @@ namespace big::troll
|
|||||||
1,
|
1,
|
||||||
value,
|
value,
|
||||||
0,
|
0,
|
||||||
1,
|
anonymous ? 1 : 0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
@ -38,4 +38,4 @@ namespace big::troll
|
|||||||
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << target->id());
|
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << target->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,12 +17,14 @@ namespace big
|
|||||||
components::player_command_button<"rcplayer">(g_player_service->get_selected());
|
components::player_command_button<"rcplayer">(g_player_service->get_selected());
|
||||||
|
|
||||||
static int bounty_value = 0;
|
static int bounty_value = 0;
|
||||||
|
|
||||||
ImGui::SliderInt("Bounty", &bounty_value, 0, 10000);
|
ImGui::SliderInt("Bounty", &bounty_value, 0, 10000);
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
components::button("Set", [] { troll::set_bounty_on_player(g_player_service->get_selected(), bounty_value);});
|
components::command_checkbox<"anonbounty">();
|
||||||
|
ImGui::SameLine();
|
||||||
|
components::button("Set", [] { troll::set_bounty_on_player(g_player_service->get_selected(), bounty_value, g.session.anonymous_bounty);});
|
||||||
|
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user