Add more spoofing options and added clang-format (#1020)

* feat(Spoofing): add spoofing
* feat(Spoofing): prepare code for player attach
* remove(PlayerAttach): isn't going to work due to netsync architecture
* fix(GUI): fix scaling
* feat(Project): add clang-format file
* feat(Classes): update classes
* fix(BlackHole): remove unnecessary cleanup
* fix(Formatting): fix formatting for initializer lists
* feat(clang-format): Set tab width and 1 space before comment

Co-authored-by: Yimura <24669514+Yimura@users.noreply.github.com>
This commit is contained in:
maybegreat48
2023-03-01 21:27:15 +00:00
committed by GitHub
parent 6a2cd866c0
commit 9ccb77e8eb
467 changed files with 55742 additions and 36204 deletions

View File

@ -1,10 +1,9 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "pointers.hpp"
#include "util/vehicle.hpp"
#include "util/mobile.hpp"
#include "util/entity.hpp"
#include "gta_util.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/entity.hpp"
#include "util/mobile.hpp"
namespace big
{
@ -15,38 +14,60 @@ namespace big
virtual void on_tick() override
{
for (auto entity : entity::get_entities(g.world.blackhole.include_vehicles, g.world.blackhole.include_peds))
{
if (entity::take_control_of(entity, 0))
{
auto entity_coord = ENTITY::GET_ENTITY_COORDS(entity, false);
ENTITY::APPLY_FORCE_TO_ENTITY(entity, 1, ((g.world.blackhole.pos.x - entity_coord.x) * 9.f), ((g.world.blackhole.pos.y - entity_coord.y) * 9.f), ((g.world.blackhole.pos.z - entity_coord.z) * 9.f), 0.f, 0.f, 0.f, 0, false, true, true, 0, 0);
ENTITY::APPLY_FORCE_TO_ENTITY(entity,
1,
((g.world.blackhole.pos.x - entity_coord.x) * 9.f),
((g.world.blackhole.pos.y - entity_coord.y) * 9.f),
((g.world.blackhole.pos.z - entity_coord.z) * 9.f),
0.f,
0.f,
0.f,
0,
false,
true,
true,
0,
0);
}
}
//draw blackhole
GRAPHICS::DRAW_MARKER(28,
g.world.blackhole.pos.x, g.world.blackhole.pos.y, g.world.blackhole.pos.z,
0.f, 0.f, 0.f, 0, 0, 0, g.world.blackhole.scale, g.world.blackhole.scale, g.world.blackhole.scale,
g.world.blackhole.color[0] * 255,
g.world.blackhole.color[1] * 255,
g.world.blackhole.color[2] * 255,
g.world.blackhole.alpha,
0, 0, 0, 0, 0, 0, 0);
//cleanup
entity::get_entities(g.world.blackhole.include_vehicles, g.world.blackhole.include_peds).clear();
}
//make sure that we always cleanup our memory
virtual void on_disable() override
{
entity::get_entities(g.world.blackhole.include_vehicles, g.world.blackhole.include_peds).clear();
g.world.blackhole.pos.x,
g.world.blackhole.pos.y,
g.world.blackhole.pos.z,
0.f,
0.f,
0.f,
0,
0,
0,
15.f,
15.f,
15.f,
g.world.blackhole.color[0] * 255,
g.world.blackhole.color[1] * 255,
g.world.blackhole.color[2] * 255,
g.world.blackhole.alpha,
0,
0,
0,
0,
0,
0,
0);
}
};
blackhole g_blackhole("blackhole", "Blackhole", "Spawns a black hole that picks up all the peds and vehicles in your area.", g.world.blackhole.enable);
bool_command g_blackhole_peds("blackholeincpeds", "Peds", "Includes all nearby peds in the blackholes path of destruction", g.world.blackhole.include_peds);
bool_command g_blackhole_vehicles("blackholeincvehs", "Vehicles", "Includes all nearby vehicles in the blackholes path of destruction", g.world.blackhole.include_vehicles);
blackhole g_blackhole("blackhole", "Blackhole", "Spawns a black hole that picks up all the peds and vehicles in your area.",
g.world.blackhole.enable);
bool_command g_blackhole_peds("blackholeincpeds", "Peds", "Includes all nearby peds in the blackholes path of destruction",
g.world.blackhole.include_peds);
bool_command g_blackhole_vehicles("blackholeincvehs", "Vehicles", "Includes all nearby vehicles in the blackholes path of destruction",
g.world.blackhole.include_vehicles);
}

View File

@ -1,5 +1,5 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/entity.hpp"
@ -12,7 +12,6 @@ namespace big
virtual void on_tick() override
{
for (auto ped : entity::get_entities(false, true))
{
PED::SET_PED_HIGHLY_PERCEPTIVE(ped, true);

View File

@ -1,5 +1,5 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/entity.hpp"
@ -10,7 +10,7 @@ namespace big
{
using looped_command::looped_command;
virtual void on_enable() override //should help for any stragglers that aren't set by the tick (aka current event)
virtual void on_enable() override//should help for any stragglers that aren't set by the tick (aka current event)
{
PLAYER::SET_EVERYONE_IGNORE_PLAYER(self::id, true);
PLAYER::SET_POLICE_IGNORE_PLAYER(self::id, true);
@ -18,10 +18,10 @@ namespace big
virtual void on_tick() override
{
for (auto ped : entity::get_entities(false, true))
{
if (!PED::GET_PED_CONFIG_FLAG(ped, 17, true)) { // Flag 17 = PED_FLAG_BLOCK_NON_TEMPORARY_EVENTS
if (!PED::GET_PED_CONFIG_FLAG(ped, 17, true))
{// Flag 17 = PED_FLAG_BLOCK_NON_TEMPORARY_EVENTS
PED::SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, true);
TASK::TASK_SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, true);
}
@ -35,6 +35,7 @@ namespace big
}
};
ignore g_ignore("pedsignore", "Ignore", "Nearby peds will ignore you and become oblivious to your actions.", g.world.nearby.ignore);
ignore g_ignore("pedsignore", "Ignore", "Nearby peds will ignore you and become oblivious to your actions.",
g.world.nearby.ignore);
}

View File

@ -1,5 +1,5 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/entity.hpp"
@ -18,11 +18,11 @@ namespace big
}
}
virtual void on_disable() override //Set the peds back to their normal speed
virtual void on_disable() override//Set the peds back to their normal speed
{
for (auto ped : entity::get_entities(false, true))
{
PED::SET_PED_MOVE_RATE_OVERRIDE(ped, 1.0f);
PED::SET_PED_MOVE_RATE_OVERRIDE(ped, 1.0f);
}
}
};

View File

@ -1,25 +1,25 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/entity.hpp"
namespace big
{
class ped_rain : looped_command
class ped_rain : looped_command
{
using looped_command::looped_command;
virtual void on_tick() override
{
for (auto ped : entity::get_entities(false, true))
{
if (!ENTITY::IS_ENTITY_IN_AIR(ped)) {
if (!ENTITY::IS_ENTITY_IN_AIR(ped))
{
Vector3 my_location = ENTITY::GET_ENTITY_COORDS(self::ped, 1);
my_location.x = my_location.x + (rand() % 100 + (-50));
my_location.y = my_location.y + (rand() % 100 + (-50));
my_location.z = my_location.z + (rand() % 50 + 50);
my_location.x = my_location.x + (rand() % 100 + (-50));
my_location.y = my_location.y + (rand() % 100 + (-50));
my_location.z = my_location.z + (rand() % 50 + 50);
ENTITY::SET_ENTITY_COORDS(ped, my_location.x, my_location.y, my_location.z, 0, 0, 0, 0);
ENTITY::SET_ENTITY_VELOCITY(ped, 0.0, 0.0, -1.0);
}

View File

@ -1,5 +1,5 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/entity.hpp"
@ -14,14 +14,14 @@ namespace big
{
for (auto vehicles : entity::get_entities(true, false))
{
if (!ENTITY::IS_ENTITY_IN_AIR(vehicles))
if (!ENTITY::IS_ENTITY_IN_AIR(vehicles))
{
if (entity::take_control_of(vehicles))
if (entity::take_control_of(vehicles))
{
Vector3 my_location = ENTITY::GET_ENTITY_COORDS(self::ped, 1);
my_location.x = my_location.x + (rand() % 100 + (-50));
my_location.y = my_location.y + (rand() % 100 + (-50));
my_location.z = my_location.z + (rand() % 20 + 100);
my_location.x = my_location.x + (rand() % 100 + (-50));
my_location.y = my_location.y + (rand() % 100 + (-50));
my_location.z = my_location.z + (rand() % 20 + 100);
ENTITY::SET_ENTITY_COORDS(vehicles, my_location.x, my_location.y, my_location.z, 0, 0, 0, 0);
ENTITY::SET_ENTITY_VELOCITY(vehicles, 0.0, 0.0, -1.0);
}
@ -30,6 +30,7 @@ namespace big
}
};
vehicle_rain g_vehicle_rain("vehiclerain", "Rain Vehicles", "Drops surround vehicles, vehicles can hit and kill you!", g.world.nearby.veh_rain);
vehicle_rain g_vehicle_rain("vehiclerain", "Rain Vehicles", "Drops surround vehicles, vehicles can hit and kill you!",
g.world.nearby.veh_rain);
}

View File

@ -49,10 +49,10 @@ namespace big
{
auto pos = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(it->spawned_for_player), false);
auto vel = NETWORK::NETWORK_GET_LAST_VEL_RECEIVED_OVER_NETWORK(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(it->spawned_for_player));
bool is_veh = PED::IS_PED_IN_ANY_VEHICLE(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(it->spawned_for_player), true) || PLAYER::IS_REMOTE_PLAYER_IN_NON_CLONED_VEHICLE(it->spawned_for_player);
bool is_veh = PED::IS_PED_IN_ANY_VEHICLE(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(it->spawned_for_player), true) || PLAYER::IS_REMOTE_PLAYER_IN_NON_CLONED_VEHICLE(it->spawned_for_player);
auto ped_pos = ENTITY::GET_ENTITY_COORDS(it->ped_handle, false);
float distance = is_veh ? 170.0f : 120.0f;
float distance = is_veh ? 170.0f : 120.0f;
float spawn_distance = is_veh ? 150.0f : 70.0f;
if (pos.x != 0.0f && SYSTEM::VDIST2(pos.x, pos.y, pos.z, ped_pos.x, ped_pos.y, ped_pos.z) > distance * distance)

View File

@ -1,9 +1,10 @@
#include "util/train.hpp"
#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
{
@ -14,7 +15,7 @@ namespace big
if (g.world.train.drive_train)
{
if (PAD::IS_CONTROL_PRESSED(0, 71))
trainSpeed++;
trainSpeed++;
if (PAD::IS_CONTROL_PRESSED(0, 72))
trainSpeed--;
@ -25,7 +26,7 @@ namespace big
void looped::derail_train()
{
int train = train::get_closest_train();
if (train != 0)
VEHICLE::SET_RENDER_TRAIN_AS_DERAILED(train, g.world.train.derail_train);
}