diff --git a/src/backend/commands/player/troll/boost_vehicle.cpp b/src/backend/commands/player/troll/boost_vehicle.cpp new file mode 100644 index 00000000..23a8484d --- /dev/null +++ b/src/backend/commands/player/troll/boost_vehicle.cpp @@ -0,0 +1,36 @@ +#include "backend/player_command.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "util/teleport.hpp" + +namespace big +{ + class boost_vehicle : player_command + { + using player_command::player_command; + + virtual void execute(player_ptr player, const std::vector& _args, const std::shared_ptr ctx) + { + Ped ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()); + if (!PED::IS_PED_IN_ANY_VEHICLE(ped, true)) + { + g_notification_service->push_warning("Toxic", "Target player is not in a vehicle."); + } + else + { + Vehicle vehicle = PED::GET_VEHICLE_PED_IS_USING(ped); + + if (entity::take_control_of(vehicle)) + { + VEHICLE::SET_VEHICLE_FORWARD_SPEED(vehicle, 79); + } + else + { + g_notification_service->push_warning("Toxic", "Failed to take control of player vehicle."); + } + } + } + }; + + boost_vehicle g_boost_vehicle("boostveh", "Boost Vehicle", "Boosts their car very fast.", 0); +} \ No newline at end of file diff --git a/src/backend/commands/player/troll/burst_tyres.cpp b/src/backend/commands/player/troll/burst_tyres.cpp new file mode 100644 index 00000000..b4fcee0b --- /dev/null +++ b/src/backend/commands/player/troll/burst_tyres.cpp @@ -0,0 +1,39 @@ +#include "backend/player_command.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "util/teleport.hpp" + +namespace big +{ + class burst_tyres : player_command + { + using player_command::player_command; + + virtual void execute(player_ptr player, const std::vector& _args, const std::shared_ptr ctx) + { + Ped ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()); + if (!PED::IS_PED_IN_ANY_VEHICLE(ped, true)) + { + g_notification_service->push_warning("Toxic", "Target player is not in a vehicle."); + } + + else + { + Vehicle vehicle = PED::GET_VEHICLE_PED_IS_USING(ped); + if (entity::take_control_of(vehicle)) + { + Vehicle vehicle = PED::GET_VEHICLE_PED_IS_USING(ped); + entity::take_control_of(vehicle); + VEHICLE::SET_VEHICLE_TYRES_CAN_BURST(vehicle, true); + static int tireID = 0; + for (tireID = 0; tireID < 8; tireID++) + { + VEHICLE::SET_VEHICLE_TYRE_BURST(vehicle, tireID, true, 1000.0); + } + } + } + } + }; + + burst_tyres g_burst_tyres("burstwheels", "Burst Vehicle Tyres", "Removes their tyres.", 0); +} diff --git a/src/backend/commands/player/troll/close_doors.cpp b/src/backend/commands/player/troll/close_doors.cpp new file mode 100644 index 00000000..a6ea498a --- /dev/null +++ b/src/backend/commands/player/troll/close_doors.cpp @@ -0,0 +1,35 @@ +#include "backend/player_command.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "util/teleport.hpp" +namespace big +{ + class close_doors : player_command + { + using player_command::player_command; + + virtual void execute(player_ptr player, const std::vector& _args, const std::shared_ptr ctx) + { + Ped ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()); + if (!PED::IS_PED_IN_ANY_VEHICLE(ped, true)) + { + g_notification_service->push_warning("Toxic", "Target player is not in a vehicle."); + } + else + { + Vehicle vehicle = PED::GET_VEHICLE_PED_IS_USING(ped); + + if (entity::take_control_of(vehicle)) + { + VEHICLE::SET_VEHICLE_DOORS_SHUT(vehicle, false); + } + else + { + g_notification_service->push_warning("Toxic", "Failed to take control of vehicle."); + } + } + } + }; + + close_doors g_close_doors("closedoors", "Close Vehicle Doors", "Closes all vehicle doors", 0); +} \ No newline at end of file diff --git a/src/backend/commands/player/troll/downgrade_vehicle.cpp b/src/backend/commands/player/troll/downgrade_vehicle.cpp new file mode 100644 index 00000000..04e76134 --- /dev/null +++ b/src/backend/commands/player/troll/downgrade_vehicle.cpp @@ -0,0 +1,36 @@ +#include "backend/player_command.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "util/teleport.hpp" + +namespace big +{ + class downgrade_vehicle : player_command + { + using player_command::player_command; + + virtual void execute(player_ptr player, const std::vector& _args, const std::shared_ptr ctx) + { + Ped ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()); + Vehicle vehicle = PED::GET_VEHICLE_PED_IS_IN(ped, false); + if (!PED::IS_PED_IN_ANY_VEHICLE(vehicle, true)) + { + g_notification_service->push_warning("Toxic", "Target player is not in a vehicle."); + } + else + { + Vehicle vehicle = PED::GET_VEHICLE_PED_IS_USING(ped); + if (entity::take_control_of(vehicle)) + { + VEHICLE::SET_VEHICLE_MOD_KIT(vehicle, 0); + for (int i = 0; i < 50; i++) + { + VEHICLE::REMOVE_VEHICLE_MOD(vehicle, i); + } + } + } + } + }; + + downgrade_vehicle g_downgrade_vehicle("downgradeveh", "Downgrade Vehicle", "Removes all upgrades", 0); +} \ No newline at end of file diff --git a/src/backend/commands/player/troll/flip_180.cpp b/src/backend/commands/player/troll/flip_180.cpp new file mode 100644 index 00000000..806bb0e2 --- /dev/null +++ b/src/backend/commands/player/troll/flip_180.cpp @@ -0,0 +1,44 @@ +#include "backend/player_command.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "util/teleport.hpp" + +namespace big +{ + class flip_180 : player_command + { + using player_command::player_command; + + virtual void execute(player_ptr player, const std::vector& _args, const std::shared_ptr ctx) + { + Entity ent = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()); + float Heading = ENTITY::GET_ENTITY_HEADING(ent); + Vector3 flipCar180Coords = ENTITY::GET_ENTITY_COORDS(ent, 1); + if (!PED::IS_PED_IN_ANY_VEHICLE(ent, true)) + { + g_notification_service->push_warning("Toxic", "Target player is not in any vehicle."); + } + else + { + if (entity::take_control_of(ent)) + { + if (Heading > 180.0) + { + Heading -= 180.0; + } + else + { + Heading += 180.0; + ENTITY::SET_ENTITY_COORDS(ent, flipCar180Coords.x, flipCar180Coords.y, flipCar180Coords.z, 0, 0, 0, 1); + ENTITY::SET_ENTITY_HEADING(ent, Heading); + VEHICLE::SET_VEHICLE_FORWARD_SPEED(ent, ENTITY::GET_ENTITY_SPEED(ent)); + } + } + } + } + }; + + flip_180 + g_flip_180("flip180", "Rotate 180", "Rotates their car around", 0) + ; +} \ No newline at end of file diff --git a/src/backend/commands/player/troll/flying_vehicle.cpp b/src/backend/commands/player/troll/flying_vehicle.cpp new file mode 100644 index 00000000..9b2119c8 --- /dev/null +++ b/src/backend/commands/player/troll/flying_vehicle.cpp @@ -0,0 +1,32 @@ +#include "backend/player_command.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "util/teleport.hpp" + +namespace big +{ + class flying_vehicle : player_command + { + using player_command::player_command; + + virtual void execute(player_ptr player, const std::vector& _args, const std::shared_ptr ctx) + { + Entity ent = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()); + if (!PED::IS_PED_IN_ANY_VEHICLE(ent, true)) + { + g_notification_service->push_warning("Toxic", "Target player is not in any vehicle."); + } + else + { + ent = PED::GET_VEHICLE_PED_IS_IN(ent, false); + + if (entity::take_control_of(ent)) + { + ENTITY::APPLY_FORCE_TO_ENTITY(ent, 1, 0.f, 0.f, 50000.f, 0.f, 0.f, 0.f, 0, 0, 1, 1, 0, 1); + } + } + } + }; + + flying_vehicle g_flying_vehicle("flyingveh", "Flying Vehicle", "Catapults their car to the sky.", 0); +} \ No newline at end of file diff --git a/src/backend/commands/player/troll/kill_engine.cpp b/src/backend/commands/player/troll/kill_engine.cpp new file mode 100644 index 00000000..44bda5d2 --- /dev/null +++ b/src/backend/commands/player/troll/kill_engine.cpp @@ -0,0 +1,35 @@ +#include "backend/player_command.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "util/teleport.hpp" +namespace big +{ + class kill_engine : player_command + { + using player_command::player_command; + + virtual void execute(player_ptr player, const std::vector& _args, const std::shared_ptr ctx) + { + Ped ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()); + if (!PED::IS_PED_IN_ANY_VEHICLE(ped, true)) + { + g_notification_service->push_warning("Toxic", "Target player is not in a vehicle."); + } + else + { + Vehicle vehicle = PED::GET_VEHICLE_PED_IS_USING(ped); + + if (entity::take_control_of(vehicle)) + { + VEHICLE::SET_VEHICLE_ENGINE_HEALTH(vehicle, -4000); + } + else + { + g_notification_service->push_warning("Toxic", "Failed to take control of player vehicle."); + } + } + } + }; + + kill_engine g_kill_engine("killengine", "Kill Vehicle Engine", "Breaks their engine", 0); +} \ No newline at end of file diff --git a/src/backend/commands/player/troll/lock_doors.cpp b/src/backend/commands/player/troll/lock_doors.cpp new file mode 100644 index 00000000..4fbdfb8d --- /dev/null +++ b/src/backend/commands/player/troll/lock_doors.cpp @@ -0,0 +1,32 @@ +#include "backend/player_command.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "util/teleport.hpp" + +namespace big +{ + class lock_vehicle : player_command + { + using player_command::player_command; + + virtual void execute(player_ptr player, const std::vector& _args, const std::shared_ptr ctx) + { + int lockStatus = VEHICLE::GET_VEHICLE_DOOR_LOCK_STATUS(player->id()); + Entity ent = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()); + if (!PED::IS_PED_IN_ANY_VEHICLE(ent, true)) + { + g_notification_service->push_warning("Toxic", "Target player is not in a vehicle."); + } + else + { + if (entity::take_control_of(ent)) + { + entity::take_control_of(PED::GET_VEHICLE_PED_IS_USING(player->id())); + VEHICLE::SET_VEHICLE_DOORS_LOCKED(PED::GET_VEHICLE_PED_IS_USING(player->id()), 4); + } + } + } + }; + + lock_vehicle g_lock_vehicle("lockveh", "Lock Vehicle", "Locks vehicle doors", 0); +} \ No newline at end of file diff --git a/src/backend/commands/player/troll/open_doors.cpp b/src/backend/commands/player/troll/open_doors.cpp new file mode 100644 index 00000000..acab7f69 --- /dev/null +++ b/src/backend/commands/player/troll/open_doors.cpp @@ -0,0 +1,39 @@ +#include "backend/player_command.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "util/teleport.hpp" + +namespace big +{ + class open_doors : player_command + { + using player_command::player_command; + + virtual void execute(player_ptr player, const std::vector& _args, const std::shared_ptr ctx) + { + Ped ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()); + if (!PED::IS_PED_IN_ANY_VEHICLE(ped, true)) + { + g_notification_service->push_warning("Toxic", "Target player is not in a vehicle."); + } + else + { + Vehicle vehicle = PED::GET_VEHICLE_PED_IS_USING(ped); + + if (entity::take_control_of(vehicle)) + { + for (int i = 0; i < 7; i++) + { + VEHICLE::SET_VEHICLE_DOOR_OPEN(vehicle, i, true, false); + } + } + else + { + g_notification_service->push_warning("Toxic", "Failed to take control of vehicle"); + } + } + } + }; + + open_doors g_open_doors("opendoors", "Opens Vehicle Doors", "Opens all vehicle doors", 0); +} \ No newline at end of file diff --git a/src/backend/commands/player/troll/smash_windows.cpp b/src/backend/commands/player/troll/smash_windows.cpp new file mode 100644 index 00000000..6a716cbe --- /dev/null +++ b/src/backend/commands/player/troll/smash_windows.cpp @@ -0,0 +1,29 @@ +#include "backend/player_command.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "util/teleport.hpp" + +namespace big +{ + class smash_windows : player_command + { + using player_command::player_command; + + virtual void execute(player_ptr player, const std::vector& _args, const std::shared_ptr ctx) + { + Ped ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()); + if (PED::IS_PED_IN_ANY_VEHICLE(ped, false)) + { + entity::take_control_of(PED::GET_VEHICLE_PED_IS_USING(ped)); + Vehicle UserVeh = PED::GET_VEHICLE_PED_IS_IN(ped, false); + static int windowID = 0; + for (windowID = 0; windowID < 10; windowID++) + { + VEHICLE::SMASH_VEHICLE_WINDOW(UserVeh, windowID); + } + } + } + }; + + smash_windows g_smash_windows("smashwindows", "Smash Vehicle Windows", "Smashes all their windows", 0); +} \ No newline at end of file diff --git a/src/backend/commands/player/troll/stop_vehicle.cpp b/src/backend/commands/player/troll/stop_vehicle.cpp new file mode 100644 index 00000000..a1ec2554 --- /dev/null +++ b/src/backend/commands/player/troll/stop_vehicle.cpp @@ -0,0 +1,34 @@ +#include "backend/player_command.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "util/teleport.hpp" +namespace big +{ + class stop_vehicle : player_command + { + using player_command::player_command; + + virtual void execute(player_ptr player, const std::vector& _args, const std::shared_ptr ctx) + { + Ped ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()); + if (!PED::IS_PED_IN_ANY_VEHICLE(ped, true)) + { + g_notification_service->push_warning("Toxic", "Target player is not in a vehicle."); + } + else + { + Vehicle vehicle = PED::GET_VEHICLE_PED_IS_USING(ped); + if (entity::take_control_of(vehicle)) + { + VEHICLE::SET_VEHICLE_FORWARD_SPEED(vehicle, 0); + } + else + { + g_notification_service->push_warning("Toxic", "Failed to take control of player vehicle."); + } + } + } + }; + + stop_vehicle g_stop_vehicle("stopveh", "Stop Vehicle", "Stops players vehicle", 0); +} \ No newline at end of file diff --git a/src/backend/commands/player/troll/teleport_into_vehicle.cpp b/src/backend/commands/player/troll/teleport_into_vehicle.cpp index e46da887..eceb50c6 100644 --- a/src/backend/commands/player/troll/teleport_into_vehicle.cpp +++ b/src/backend/commands/player/troll/teleport_into_vehicle.cpp @@ -18,5 +18,5 @@ namespace big } }; - teleport_into_vehicle g_teleport_into_vehicle("playervehtp", "Teleport Into Vehicle", "Take control of the player's vehicle. Spectate the player beforehand for best results", 0, false); + teleport_into_vehicle g_teleport_into_vehicle("playervehtp", "Teleport Into Vehicle", "Teleports into the players vehicle. Spectate the player beforehand for best results", 0, false); } \ No newline at end of file diff --git a/src/backend/commands/player/troll/unlock_doors.cpp b/src/backend/commands/player/troll/unlock_doors.cpp new file mode 100644 index 00000000..386ad5b2 --- /dev/null +++ b/src/backend/commands/player/troll/unlock_doors.cpp @@ -0,0 +1,22 @@ +#include "backend/player_command.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "util/teleport.hpp" +namespace big +{ + class unlock_vehicle : player_command + { + using player_command::player_command; + + virtual void execute(player_ptr player, const std::vector& _args, const std::shared_ptr ctx) + { + if (PED::IS_PED_IN_ANY_VEHICLE((player->id()), false)) + { + entity::take_control_of(PED::GET_VEHICLE_PED_IS_USING(player->id())); + VEHICLE::SET_VEHICLE_DOORS_LOCKED(PED::GET_VEHICLE_PED_IS_USING(player->id()), 0); + } + } + }; + + unlock_vehicle g_unlock_vehicle("unlockveh", "Unlock Vehicle Doors", "Unlocks Vehicle Doors", 0); +} \ No newline at end of file diff --git a/src/backend/commands/player/troll/upgrade_vehicle.cpp b/src/backend/commands/player/troll/upgrade_vehicle.cpp new file mode 100644 index 00000000..67f13f86 --- /dev/null +++ b/src/backend/commands/player/troll/upgrade_vehicle.cpp @@ -0,0 +1,21 @@ +#include "backend/player_command.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "util/teleport.hpp" +#include "util/vehicle.hpp" + +namespace big +{ + class upgrade_vehicle : player_command + { + using player_command::player_command; + + virtual void execute(player_ptr player, const std::vector& _args, const std::shared_ptr ctx) + { + Vehicle vehicle = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()), false); + vehicle::max_vehicle(vehicle); + } + }; + + upgrade_vehicle g_upgrade_vehicle("upgradeveh", "Upgrade Vehicle", "Upgrades players vehicle", 0); +} \ No newline at end of file diff --git a/src/backend/commands/player/troll/window_tint.cpp b/src/backend/commands/player/troll/window_tint.cpp new file mode 100644 index 00000000..26de85a8 --- /dev/null +++ b/src/backend/commands/player/troll/window_tint.cpp @@ -0,0 +1,27 @@ +#include "backend/player_command.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "util/teleport.hpp" +#include "util/vehicle.hpp" + +namespace big +{ + class black_tint : player_command + { + using player_command::player_command; + + virtual void execute(player_ptr player, const std::vector& _args, const std::shared_ptr ctx) + { + Ped ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()); + if (PED::IS_PED_IN_ANY_VEHICLE(ped, false)) + { + entity::take_control_of(PED::GET_VEHICLE_PED_IS_USING(ped)); + Vehicle UserVeh = PED::GET_VEHICLE_PED_IS_IN(ped, false); + + VEHICLE::SET_VEHICLE_WINDOW_TINT(UserVeh, WINDOWTINT_BLACK); + } + } + }; + + black_tint g_black_tint("blacktint", "Black Window Tint", "Makes their windows black.", 0); +} \ No newline at end of file diff --git a/src/views/players/player/player_info.cpp b/src/views/players/player/player_info.cpp index a23fc698..46227bbe 100644 --- a/src/views/players/player/player_info.cpp +++ b/src/views/players/player/player_info.cpp @@ -3,6 +3,7 @@ #include "core/scr_globals.hpp" #include "services/player_database/player_database_service.hpp" #include "views/view.hpp" +#include "natives.hpp" #include