Toxic features and improve protections (#897)

This commit is contained in:
maybegreat48
2023-01-22 21:57:32 +00:00
committed by GitHub
parent f360d7f436
commit d45d0c1ffc
59 changed files with 8056 additions and 6801 deletions

View File

@ -0,0 +1,208 @@
#include "views/view.hpp"
#include "fiber_pool.hpp"
#include "gta_util.hpp"
#include "core/scr_globals.hpp"
#include "script_local.hpp"
#include "util/scripts.hpp"
namespace big
{
static bool mission_found = false;
inline rage::scrThread* check_script(rage::joaat_t hash)
{
if (auto thread = gta_util::find_script_thread(hash))
{
mission_found = true;
return thread;
}
return nullptr;
}
void view::missions()
{
mission_found = false;
components::sub_title("Event Starter");
ImGui::BeginGroup();
components::button("Hot Target", [] { scripts::start_launcher_script(36); });
components::button("Kill List", [] { scripts::start_launcher_script(37); });
components::button("Checkpoints", [] { scripts::start_launcher_script(39); });
components::button("Challenges", [] { scripts::start_launcher_script(40); });
components::button("Penned In", [] { scripts::start_launcher_script(41); });
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
components::button("Hot Property", [] { scripts::start_launcher_script(43); });
components::button("King Of The Castle", [] { scripts::start_launcher_script(45); });
components::button("Criminal Damage", [] { scripts::start_launcher_script(46); });
components::button("Hunt The Beast", [] { scripts::start_launcher_script(47); });
components::button("Business Battles", [] { scripts::start_launcher_script(114); });
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
components::button("One-On-One Deathmatch", [] { scripts::start_launcher_script(197); });
components::button("Impromptu Race", [] { scripts::start_launcher_script(16); });
components::button("Flight School", [] { scripts::start_launcher_script(196); });
components::button("Golf", [] { scripts::start_launcher_script(193); });
components::button("Tutorial", [] { scripts::start_launcher_script(20); });
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Only works on joining players");
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
components::button("Gunslinger", [] { scripts::start_launcher_script(211); });
components::button("Space Monkey", [] { scripts::start_launcher_script(216); });
components::button("Wizard", [] { scripts::start_launcher_script(212); });
components::button("QUB3D", [] { scripts::start_launcher_script(217); });
components::button("Camhedz", [] { scripts::start_launcher_script(218); });
ImGui::EndGroup();
ImGui::Separator();
if (check_script(RAGE_JOAAT("am_criminal_damage")))
{
components::sub_title("Criminal Damage");
components::button("Start Event##criminal_damage", [] {
if (scripts::force_host(RAGE_JOAAT("am_criminal_damage")))
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("am_criminal_damage")))
*script_local(script->m_stack, scr_locals::am_criminal_damage::broadcast_idx).at(43).as<int*>() = 0;
});
ImGui::SameLine();
components::button("Finish Event##criminal_damage", []
{
if (scripts::force_host(RAGE_JOAAT("am_criminal_damage")))
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("am_criminal_damage")))
*script_local(script->m_stack, scr_locals::am_criminal_damage::broadcast_idx).at(39).as<int*>() = 0;
});
components::button("Max Score", []
{
if (auto criminal_damage = gta_util::find_script_thread(RAGE_JOAAT("am_criminal_damage")))
*script_local(criminal_damage->m_stack, scr_locals::am_criminal_damage::score_idx).as<int*>() = 999'999'999;
});
}
if (check_script(RAGE_JOAAT("am_cp_collection")))
{
components::sub_title("Checkpoints");
components::button("Start Event##cp_collection", []
{
if (scripts::force_host(RAGE_JOAAT("am_cp_collection")))
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("am_cp_collection")))
*script_local(script->m_stack, scr_locals::am_cp_collection::broadcast_idx).at(667).as<int*>() = 0;
});
ImGui::SameLine();
components::button("Finish Event##cp_collection", []
{
if (scripts::force_host(RAGE_JOAAT("am_cp_collection")))
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("am_cp_collection")))
*script_local(script->m_stack, scr_locals::am_cp_collection::broadcast_idx).at(661).as<int*>() = 0;
});
components::button("Win Event", []
{
if (auto checkpoints = gta_util::find_script_thread(RAGE_JOAAT("am_cp_collection")))
*script_local(checkpoints->m_stack, scr_locals::am_cp_collection::player_broadcast_idx).at(checkpoints->m_net_component->m_local_participant_index, 5).at(4).as<int*>() = 999'999'999;
script::get_current()->yield(1s);
if (scripts::force_host(RAGE_JOAAT("am_cp_collection")))
{
if (auto checkpoints = gta_util::find_script_thread(RAGE_JOAAT("am_cp_collection")))
{
*script_local(checkpoints->m_stack, scr_locals::am_cp_collection::broadcast_idx).at(708).as<int*>() = 0;
}
}
});
ImGui::SameLine();
components::button("Scramble Checkpoints", []
{
std::vector<Vector3> active_player_positions;
for (auto& plyr : g_player_service->players())
{
if (plyr.second->is_valid() && NETWORK::NETWORK_IS_PLAYER_A_PARTICIPANT_ON_SCRIPT(plyr.second->id(), "am_cp_collection", -1))
{
active_player_positions.push_back(ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(plyr.second->id()), false));
}
}
if (scripts::force_host(RAGE_JOAAT("am_cp_collection")))
{
if (auto checkpoints = gta_util::find_script_thread(RAGE_JOAAT("am_cp_collection")))
{
for (int i = 0; i < 100; i++)
{
*script_local(checkpoints->m_stack, scr_locals::am_cp_collection::broadcast_idx).at(10).at(i, 5).as<Vector3*>() = active_player_positions[i % active_player_positions.size()];
}
}
}
});
}
if (check_script(RAGE_JOAAT("am_king_of_the_castle")))
{
components::sub_title("King Of The Castle");
components::button("Complete Event##kotc", []
{
if (scripts::force_host(RAGE_JOAAT("am_king_of_the_castle")))
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("am_king_of_the_castle")))
*script_local(script->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(1).at(1).as<int*>() = 0;
});
ImGui::SameLine();
components::button("Expire Event (if possible)##kotc", []
{
if (scripts::force_host(RAGE_JOAAT("am_king_of_the_castle")))
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("am_king_of_the_castle")))
*script_local(script->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(1).at(3).as<int*>() = 0;
});
components::button("Become The King##kotc", []
{
if (scripts::force_host(RAGE_JOAAT("am_king_of_the_castle")))
{
if (auto kotc = gta_util::find_script_thread(RAGE_JOAAT("am_king_of_the_castle")))
{
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).at(0, 4).as<int*>() = 0;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).at(0, 4).at(1).as<int*>() = self::id;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).at(0, 4).at(2).as<int*>() = self::id;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).at(0, 4).at(3).as<float*>() = 999999999.0f;
}
}
});
ImGui::SameLine();
components::button("Dethrone Everyone##kotc", []
{
if (scripts::force_host(RAGE_JOAAT("am_king_of_the_castle")))
{
if (auto kotc = gta_util::find_script_thread(RAGE_JOAAT("am_king_of_the_castle")))
{
for (int i = 0; i < *script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).as<int*>(); i++)
{
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).at(i, 4).as<int*>() = -1;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).at(i, 4).at(1).as<int*>() = -1;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).at(i, 4).at(2).as<int*>() = -1;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).at(i, 4).at(3).as<float*>() = -1.0f;
}
}
}
});
}
if (!mission_found)
{
ImGui::Text("No active mission");
}
}
}

View File

@ -160,6 +160,10 @@ namespace big
scripts::force_host(RAGE_JOAAT("freemode"));
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("freemode")); script && script->m_net_component)
script->m_net_component->block_host_migration(true);
scripts::force_host(RAGE_JOAAT("fmmc_launcher"));
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("fmmc_launcher")); script && script->m_net_component)
script->m_net_component->block_host_migration(true);
});
}
@ -219,7 +223,6 @@ namespace big
ImGui::SameLine();
components::command_button<"beastall">({ });
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Including you");
@ -233,8 +236,23 @@ namespace big
components::command_button<"vehkickall">({ });
components::command_button<"ragdollall">({ }, "Ragdoll Players");
ImGui::SameLine();
components::command_button<"intkickall">({ }, "Kick Everyone From Interiors");
components::command_button<"missionall">({ });
ImGui::SameLine();
components::command_button<"errorall">({ });
components::command_button<"ceoraidall">({ });
ImGui::SameLine();
components::button("Trigger MC Raid", [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::BikerDefend); }); });
ImGui::SameLine();
components::button("Trigger Bunker Raid", [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::GunrunningDefend); }); });
components::command_button<"sextall">({ }, "Send Sexts");
ImGui::SameLine();
components::command_button<"fakebanall">({ }, "Send Fake Ban Messages");
components::small_text("Teleports");
if (ImGui::BeginCombo("##apartment", apartment_names[g.session.send_to_apartment_idx]))
@ -311,47 +329,23 @@ namespace big
ImGui::SameLine();
components::command_button<"interiortpall">({ 161 }, "TP All To Multi Floor Garage");
components::sub_title("Event Starter");
ImGui::BeginGroup();
components::button("Hot Target", [] { scripts::start_launcher_script(36); });
components::button("Kill List", [] { scripts::start_launcher_script(37); });
components::button("Checkpoints", [] { scripts::start_launcher_script(39); });
components::button("Challenges", [] { scripts::start_launcher_script(40); });
components::button("Penned In", [] { scripts::start_launcher_script(41); });
ImGui::EndGroup();
components::command_button<"tutorialall">();
ImGui::SameLine();
ImGui::BeginGroup();
components::button("Hot Property", [] { scripts::start_launcher_script(43); });
components::button("King Of The Castle", [] { scripts::start_launcher_script(45); });
components::button("Criminal Damage", [] { scripts::start_launcher_script(46); });
components::button("Hunt The Beast", [] { scripts::start_launcher_script(47); });
components::button("Business Battles", [] { scripts::start_launcher_script(114); });
ImGui::EndGroup();
components::command_button<"golfall">();
ImGui::SameLine();
ImGui::BeginGroup();
components::button("One-On-One Deathmatch", [] { scripts::start_launcher_script(197); });
components::button("Impromptu Race", [] { scripts::start_launcher_script(16); });
components::button("Flight School", [] { scripts::start_launcher_script(196); });
components::button("Golf", [] { scripts::start_launcher_script(193); });
components::button("Tutorial", [] { scripts::start_launcher_script(20); });
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Only works on joining players");
ImGui::EndGroup();
components::command_button<"flightschoolall">();
ImGui::SameLine();
components::command_button<"dartsall">();
ImGui::BeginGroup();
components::button("Gunslinger", [] { scripts::start_launcher_script(211); });
components::button("Space Monkey", [] { scripts::start_launcher_script(216); });
components::button("Wizard", [] { scripts::start_launcher_script(212); });
components::button("QUB3D", [] { scripts::start_launcher_script(217); });
components::button("Camhedz", [] { scripts::start_launcher_script(218); });
ImGui::EndGroup();
components::command_button<"badlandsall">();
ImGui::SameLine();
components::command_button<"spacemonkeyall">();
ImGui::SameLine();
components::command_button<"wizardall">();
components::command_button<"qub3dall">();
ImGui::SameLine();
components::command_button<"camhedzall">();
ImGui::Checkbox("Disable Pedestrians", &g.session.disable_peds);
ImGui::SameLine();
@ -381,5 +375,12 @@ namespace big
ImGui::SetTooltip("Blocks CEO money drops across the entire session. This can also break other stuff, use with caution");
ImGui::SameLine();
ImGui::Checkbox("Randomize CEO Colors", &g.session.randomize_ceo_colors);
ImGui::Checkbox("Block Jobs", &g.session.block_jobs);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Prevents remote players from starting jobs while in your session");
ImGui::SameLine();
components::script_patch_checkbox("Block Muggers", &g.session.block_muggers, "For the entire session");
ImGui::SameLine();
components::script_patch_checkbox("Block CEO Raids", &g.session.block_ceo_raids, "For the entire session");
}
}