diff --git a/src/backend/backend.cpp b/src/backend/backend.cpp index b6fd033a..32a5a462 100644 --- a/src/backend/backend.cpp +++ b/src/backend/backend.cpp @@ -76,6 +76,8 @@ namespace big looped::vehicle_boost_behavior(); looped::vehicle_god_mode(); looped::vehicle_speedo_meter(); + looped::derail_train(); + looped::drive_train(); script::get_current()->yield(); } diff --git a/src/backend/commands/player/troll/set_bounty.cpp b/src/backend/commands/player/troll/set_bounty.cpp new file mode 100644 index 00000000..cdf2db72 --- /dev/null +++ b/src/backend/commands/player/troll/set_bounty.cpp @@ -0,0 +1,19 @@ +#include "backend/player_command.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "util/troll.hpp" + +namespace big +{ + class set_bounty : player_command + { + using player_command::player_command; + + virtual void execute(player_ptr player, const std::vector& _args, const std::shared_ptr ctx) + { + troll::set_bounty_on_player(player, 10000); + } + }; + + set_bounty g_bounty("bounty", "Bounty", "Sets a 10k bounty on the player", 0); +} \ No newline at end of file diff --git a/src/backend/looped/looped.hpp b/src/backend/looped/looped.hpp index 78729688..c4952529 100644 --- a/src/backend/looped/looped.hpp +++ b/src/backend/looped/looped.hpp @@ -51,5 +51,8 @@ namespace big static void weapons_repair_gun(); static void weapons_steal_vehicle_gun(); static void weapons_vehicle_gun(); + + static void drive_train(); + static void derail_train(); }; } diff --git a/src/backend/looped/world/train.cpp b/src/backend/looped/world/train.cpp new file mode 100644 index 00000000..90f281c6 --- /dev/null +++ b/src/backend/looped/world/train.cpp @@ -0,0 +1,32 @@ +#include "backend/looped/looped.hpp" +#include "gta/enums.hpp" +#include "natives.hpp" +#include "util/blip.hpp" +#include "util/entity.hpp" +#include "util/train.hpp" + +namespace big +{ + void looped::drive_train() + { + int trainSpeed = ENTITY::GET_ENTITY_SPEED(train::get_closest_train()); + + if (g.train.drive_train) + { + if (PAD::IS_CONTROL_PRESSED(0, 71)) + trainSpeed++; + if (PAD::IS_CONTROL_PRESSED(0, 72)) + trainSpeed--; + + train::set_train_speed(trainSpeed); + } + } + + void looped::derail_train() + { + int train = train::get_closest_train(); + + if (train != 0) + VEHICLE::SET_RENDER_TRAIN_AS_DERAILED(train, g.train.derail_train); + } +} \ No newline at end of file diff --git a/src/core/globals.hpp b/src/core/globals.hpp index 31648a64..c08067f5 100644 --- a/src/core/globals.hpp +++ b/src/core/globals.hpp @@ -387,6 +387,12 @@ namespace big NLOHMANN_DEFINE_TYPE_INTRUSIVE(spawn_ped, preview_ped) } spawn_ped{}; + struct train + { + bool derail_train = false; + bool drive_train = false; + } train{}; + struct spoofing { bool spoof_username = false; diff --git a/src/services/gui/gui_service.hpp b/src/services/gui/gui_service.hpp index e4c75bca..7e9fb3c4 100644 --- a/src/services/gui/gui_service.hpp +++ b/src/services/gui/gui_service.hpp @@ -27,6 +27,7 @@ namespace big SPAWN_PED, TIME_AND_WEATHER, CREATOR, + TRAIN, NETWORK, SESSION, @@ -77,7 +78,8 @@ namespace big { tabs::WORLD, { "World", nullptr, { { tabs::SPAWN_PED, { "Spawn Ped", view::spawn_ped }}, { tabs::TIME_AND_WEATHER, { "Time And Weather", view::time_and_weather }}, - { tabs::CREATOR, { "Creator", view::creator }} + { tabs::CREATOR, { "Creator", view::creator }}, + { tabs::TRAIN, { "Train", view::train }} }}}, {tabs::NETWORK, { "Network", nullptr, { { tabs::SPOOFING, { "Spoofing", view::spoofing }}, diff --git a/src/util/mobile.hpp b/src/util/mobile.hpp index 9a158831..25cf06a3 100644 --- a/src/util/mobile.hpp +++ b/src/util/mobile.hpp @@ -31,14 +31,14 @@ namespace big::mobile return *script_global(2359296).at(0, 5568).at(681).at(2).as(); } } - + namespace merry_weather { inline void request_ammo_drop() { *script_global(scr_globals::mechanic_global).at(886).as() = 1; } - + inline void request_helicopter_pickup() { *script_global(scr_globals::mechanic_global).at(888).as() = 1; @@ -144,4 +144,4 @@ namespace big::mobile } } } -} +} \ No newline at end of file diff --git a/src/util/spam.hpp b/src/util/spam.hpp index 3ca3c15e..54e2d7e7 100644 --- a/src/util/spam.hpp +++ b/src/util/spam.hpp @@ -36,7 +36,8 @@ namespace "ezcars", "PLANO INICIAL", // "initial plan" "REP +", - "20R$" // Brazil currency? + "20R$", // Brazil currency? + "l55.me" }; } diff --git a/src/util/toxic.hpp b/src/util/toxic.hpp index 8c59c3f0..f4ded625 100644 --- a/src/util/toxic.hpp +++ b/src/util/toxic.hpp @@ -149,4 +149,5 @@ namespace big::toxic { set_time_all((*g_pointers->m_network_time)->m_time + millis); } + } \ No newline at end of file diff --git a/src/util/train.hpp b/src/util/train.hpp new file mode 100644 index 00000000..c99dedda --- /dev/null +++ b/src/util/train.hpp @@ -0,0 +1,74 @@ +#pragma once +#include "gta/enums.hpp" +#include "services/players/player_service.hpp" +#include "script_global.hpp" +#include "pointers.hpp" +#include "natives.hpp" +#include "entity.hpp" + +namespace big::train +{ + inline auto get_all_vehicles() + { + std::vector result; + rage::CReplayInterface* CReplayInterface_var = *g_pointers->m_replay_interface; + for (int i = 0; i < 300; i++) + { + auto vehicle_ptr = CReplayInterface_var->m_vehicle_interface->get_vehicle(i); + if (vehicle_ptr) + { + Vehicle vehicle_handle = g_pointers->m_ptr_to_handle(vehicle_ptr); + + result.push_back(vehicle_handle); + } + } + return result; + }; + + inline int get_closest_train() + { + auto allVehicles = get_all_vehicles(); + + for (int i = 0; i < allVehicles.size(); i++) + { + if (ENTITY::GET_ENTITY_MODEL(allVehicles[i]) == 1030400667) + return allVehicles[i]; + } + return 0; + } + + inline void hijack_train() + { + auto train = get_closest_train(); + + if (train != 0) + { + entity::take_control_of(train); + PED::SET_PED_INTO_VEHICLE(PLAYER::PLAYER_PED_ID(), train, -1); + + g_notification_service->push_error("Hijack Train", "Found a train nearby"); + } + } + + inline void delete_train() + { + + if (!PED::IS_PED_IN_ANY_VEHICLE(PLAYER::PLAYER_PED_ID(), false) && get_closest_train() != 0) + { + VEHICLE::DELETE_ALL_TRAINS(); + g_notification_service->push_error("Hijack Train", "Deleted the nearby train"); + } + } + + inline void exit_train() + { + if (PED::IS_PED_IN_ANY_VEHICLE(PLAYER::PLAYER_PED_ID(), false)) + TASK::CLEAR_PED_TASKS_IMMEDIATELY(PLAYER::PLAYER_PED_ID()); + } + + inline void set_train_speed(float value) + { + if (PED::IS_PED_IN_ANY_VEHICLE(PLAYER::PLAYER_PED_ID(), false)) + VEHICLE::SET_TRAIN_CRUISE_SPEED(get_closest_train(), value); + } +} \ No newline at end of file diff --git a/src/util/troll.hpp b/src/util/troll.hpp new file mode 100644 index 00000000..b7cd5ce7 --- /dev/null +++ b/src/util/troll.hpp @@ -0,0 +1,41 @@ +#pragma once +#include "gta/enums.hpp" +#include "services/players/player_service.hpp" +#include "script_global.hpp" +#include "pointers.hpp" + +namespace big::troll +{ + inline void set_bounty_on_player(player_ptr target, int value) + { + const size_t arg_count = 22; + int64_t args[arg_count] = + { + (int64_t)eRemoteEvent::Bounty, + self::id, + target->id(), + 1, + value, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + *script_global(1923597).at(9).as(), + *script_global(1923597).at(10).as() + }; + + g_pointers->m_trigger_script_event(1, args, arg_count, 1 << target->id()); + } + +} \ No newline at end of file diff --git a/src/views/network/view_session.cpp b/src/views/network/view_session.cpp index dd286d91..399fc030 100644 --- a/src/views/network/view_session.cpp +++ b/src/views/network/view_session.cpp @@ -287,8 +287,10 @@ namespace big components::button("TP All To Skydive", [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::Skydive); }); }); ImGui::SameLine(); + components::command_button<"interiortpall">({ 81 }, "TP All To MOC"); + ImGui::SameLine(); components::command_button<"interiortpall">({ 123 }, "TP All To Casino"); ImGui::SameLine(); components::command_button<"interiortpall">({ 124 }, "TP All To Penthouse"); diff --git a/src/views/players/player/player_toxic.cpp b/src/views/players/player/player_toxic.cpp index cc270d6c..5c39720a 100644 --- a/src/views/players/player/player_toxic.cpp +++ b/src/views/players/player/player_toxic.cpp @@ -103,7 +103,8 @@ namespace big components::player_command_button<"interiortp">(g_player_service->get_selected(), { 160 }, "TP To Freakshop"); ImGui::SameLine(); components::player_command_button<"interiortp">(g_player_service->get_selected(), { 161 }, "TP To Multi Floor Garage"); - + ImGui::SameLine(); + components::player_command_button<"giveweaps">(g_player_service->get_selected(), { }); ImGui::SameLine(); components::player_command_button<"remweaps">(g_player_service->get_selected(), { }); diff --git a/src/views/players/player/player_troll.cpp b/src/views/players/player/player_troll.cpp index 34a42a71..e23da373 100644 --- a/src/views/players/player/player_troll.cpp +++ b/src/views/players/player/player_troll.cpp @@ -1,6 +1,7 @@ #include "views/view.hpp" #include "util/teleport.hpp" #include "util/vehicle.hpp" +#include "util/troll.hpp" namespace big { @@ -12,10 +13,15 @@ namespace big ImGui::SameLine(); components::player_command_button<"bring">(g_player_service->get_selected()); - components::player_command_button<"playervehtp">(g_player_service->get_selected()); components::player_command_button<"rcplayer">(g_player_service->get_selected()); + static int bounty_value = 0; + + ImGui::SliderInt("Bounty", &bounty_value, 0, 10000); + ImGui::SameLine(); + components::button("Set", [] { troll::set_bounty_on_player(g_player_service->get_selected(), bounty_value);}); + ImGui::TreePop(); } } diff --git a/src/views/self/view_mobile.cpp b/src/views/self/view_mobile.cpp index b6ad7e6c..751fd477 100644 --- a/src/views/self/view_mobile.cpp +++ b/src/views/self/view_mobile.cpp @@ -7,7 +7,7 @@ namespace big { void view::mobile() { ImGui::SetWindowSize({ 0.f, (float)*g_pointers->m_resolution_y }, ImGuiCond_Always); - + components::sub_title("Merryweather"); ImGui::Separator(); @@ -45,4 +45,4 @@ namespace big }); } -} +} \ No newline at end of file diff --git a/src/views/view.hpp b/src/views/view.hpp index ab6f46be..d53fd760 100644 --- a/src/views/view.hpp +++ b/src/views/view.hpp @@ -47,6 +47,7 @@ namespace big static void context_menu(); static void gta_data(); static void creator(); + static void train(); static void player_info(); static void player_troll(); diff --git a/src/views/world/view_train.cpp b/src/views/world/view_train.cpp new file mode 100644 index 00000000..4d95a23e --- /dev/null +++ b/src/views/world/view_train.cpp @@ -0,0 +1,46 @@ +#include "views/view.hpp" +#include "util/train.hpp" + +#include + + +namespace big +{ + void view::train() + { + components::button("Hijack Train", [] + { + train::hijack_train(); + }); + + ImGui::SameLine(); + + components::button("Delete Train", [] + { + train::delete_train(); + }); + + if (ImGui::IsItemHovered()) + ImGui::SetTooltip("You cant delete the train while in it."); + + ImGui::SameLine(); + + components::button("Exit Train", [] + { + train::exit_train(); + }); + + static float train_speed = 0; + + ImGui::SliderFloat("Train Speed", &train_speed, -500.f, 500.f); + ImGui::SameLine(); + components::button("Set", [] { train::set_train_speed(train_speed); }); + + ImGui::Checkbox("Drive Train", &g.train.drive_train); + + ImGui::SameLine(); + + ImGui::Checkbox("Derail Train", &g.train.derail_train); + + } +} \ No newline at end of file