Editor+ (#745)
* feat(Toxic): add send to island * feat(mobile): add helicopter backup * refractor(mobile): update seperator * feat(Troll): add set bounty * tps tp all to island tp all to eclipse tp to eclipse * working hijack &, delete. + placeholders * speed, derail * drive train, working derail * improved drive train * exit train, rework delete * using CReplayInterface
This commit is contained in:
parent
cd7e5c326d
commit
5260b27899
@ -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();
|
||||
}
|
||||
|
19
src/backend/commands/player/troll/set_bounty.cpp
Normal file
19
src/backend/commands/player/troll/set_bounty.cpp
Normal file
@ -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<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
|
||||
{
|
||||
troll::set_bounty_on_player(player, 10000);
|
||||
}
|
||||
};
|
||||
|
||||
set_bounty g_bounty("bounty", "Bounty", "Sets a 10k bounty on the player", 0);
|
||||
}
|
@ -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();
|
||||
};
|
||||
}
|
||||
|
32
src/backend/looped/world/train.cpp
Normal file
32
src/backend/looped/world/train.cpp
Normal file
@ -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);
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
@ -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 }},
|
||||
|
@ -31,14 +31,14 @@ namespace big::mobile
|
||||
return *script_global(2359296).at(0, 5568).at(681).at(2).as<int*>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace merry_weather
|
||||
{
|
||||
inline void request_ammo_drop()
|
||||
{
|
||||
*script_global(scr_globals::mechanic_global).at(886).as<int*>() = 1;
|
||||
}
|
||||
|
||||
|
||||
inline void request_helicopter_pickup()
|
||||
{
|
||||
*script_global(scr_globals::mechanic_global).at(888).as<int*>() = 1;
|
||||
@ -144,4 +144,4 @@ namespace big::mobile
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -36,7 +36,8 @@ namespace
|
||||
"ezcars",
|
||||
"PLANO INICIAL", // "initial plan"
|
||||
"REP +",
|
||||
"20R$" // Brazil currency?
|
||||
"20R$", // Brazil currency?
|
||||
"l55.me"
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -149,4 +149,5 @@ namespace big::toxic
|
||||
{
|
||||
set_time_all((*g_pointers->m_network_time)->m_time + millis);
|
||||
}
|
||||
|
||||
}
|
74
src/util/train.hpp
Normal file
74
src/util/train.hpp
Normal file
@ -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<Vehicle> 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);
|
||||
}
|
||||
}
|
41
src/util/troll.hpp
Normal file
41
src/util/troll.hpp
Normal file
@ -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<int64_t*>(),
|
||||
*script_global(1923597).at(10).as<int64_t*>()
|
||||
};
|
||||
|
||||
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << target->id());
|
||||
}
|
||||
|
||||
}
|
@ -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");
|
||||
|
@ -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(), { });
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -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();
|
||||
|
46
src/views/world/view_train.cpp
Normal file
46
src/views/world/view_train.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
#include "views/view.hpp"
|
||||
#include "util/train.hpp"
|
||||
|
||||
#include <imgui_internal.h>
|
||||
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user