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 92aea20cd6
commit 97a8c5d60b
466 changed files with 55224 additions and 35596 deletions

74
.clang-format Normal file
View File

@ -0,0 +1,74 @@
BasedOnStyle: Microsoft
AccessModifierOffset: '-4'
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: 'true'
AlignEscapedNewlines: Left
AlignOperands: 'false'
AlignTrailingComments: 'true'
AllowAllArgumentsOnNextLine: 'false'
AllowAllConstructorInitializersOnNextLine: 'false'
AllowAllParametersOfDeclarationOnNextLine: 'false'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'true'
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: 'false'
AlwaysBreakTemplateDeclarations: 'Yes'
BinPackArguments: 'false'
BinPackParameters: 'true'
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: 'false'
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: 'false'
CompactNamespaces: 'false'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'false'
ConstructorInitializerIndentWidth: '4'
Cpp11BracedListStyle: 'true'
DerivePointerAlignment: 'false'
FixNamespaceComments: 'false'
IncludeBlocks: Regroup
IndentCaseLabels: 'false'
IndentPPDirectives: BeforeHash
IndentWidth: '4'
TabWidth: 4
IndentWrappedFunctionNames: 'true'
KeepEmptyLinesAtTheStartOfBlocks: 'false'
Language: Cpp
MacroBlockBegin: '0'
MaxEmptyLinesToKeep: '2'
NamespaceIndentation: All
PenaltyExcessCharacter: '0'
PenaltyReturnTypeOnItsOwnLine: '0'
PointerAlignment: Left
ReflowComments: 'false'
SortIncludes: 'true'
SortUsingDeclarations: 'true'
SpaceAfterCStyleCast: 'false'
SpaceAfterLogicalNot: 'false'
SpaceAfterTemplateKeyword: 'false'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeCpp11BracedList: 'false'
SpaceBeforeCtorInitializerColon: 'true'
SpaceBeforeInheritanceColon: 'true'
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: 'true'
SpaceInEmptyParentheses: 'false'
SpacesBeforeTrailingComments: '1'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInContainerLiterals: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
Standard: Auto
UseTab: ForIndentation
BreakBeforeBraces: Custom
BraceWrapping:
BeforeLambdaBody: 'false'
AfterCaseLabel: 'true'
PackConstructorInitializers: Never

View File

@ -3,7 +3,7 @@ include(FetchContent)
FetchContent_Declare(
gtav_classes
GIT_REPOSITORY https://github.com/Yimura/GTAV-Classes.git
GIT_TAG 9bf112e0431e3618978a8dd2fec12ffeeb7dd7ce
GIT_TAG f71748dd1dfac7b1c678e0e8b87d2739bde314b6
GIT_PROGRESS TRUE
CONFIGURE_COMMAND ""
BUILD_COMMAND ""

View File

@ -1,10 +1,11 @@
#include "backend.hpp"
#include "script.hpp"
#include "thread_pool.hpp"
#include "looped/looped.hpp"
#include "services/context_menu/context_menu_service.hpp"
#include "script_patches.hpp"
#include "looped_command.hpp"
#include "script.hpp"
#include "script_patches.hpp"
#include "services/context_menu/context_menu_service.hpp"
#include "thread_pool.hpp"
namespace big
{
@ -169,7 +170,6 @@ namespace big
while (g_running)
{
looped::custom_gun_disable_control_action();
context_menu_service::disable_control_action_loop();
@ -183,7 +183,6 @@ namespace big
while (g_running)
{
looped::world_spawn_ped();
script::get_current()->yield();
}

View File

@ -9,12 +9,22 @@ namespace big
bool& m_toggle;
virtual void execute(const std::vector<std::uint64_t>& args, const std::shared_ptr<command_context> ctx = std::make_shared<default_command_context>()) override;
virtual std::optional<std::vector<std::uint64_t>> parse_args(const std::vector<std::string>& args, const std::shared_ptr<command_context> ctx = std::make_shared<default_command_context>()) override;
public:
bool_command(const std::string& name, const std::string& label, const std::string& description, bool& toggle);
inline bool& is_enabled() { return m_toggle; }
inline bool& is_enabled()
{
return m_toggle;
}
virtual void refresh(){};
virtual void enable() { m_toggle = true; };
virtual void disable() { m_toggle = false; };
virtual void enable()
{
m_toggle = true;
};
virtual void disable()
{
m_toggle = false;
};
};
}

View File

@ -1,4 +1,5 @@
#include "command.hpp"
#include "fiber_pool.hpp"
namespace
@ -40,7 +41,10 @@ namespace big
{
if (m_num_args.has_value() && args.size() != m_num_args.value())
{
ctx->report_error(std::format("Command {} called with the wrong number of arguments. Expected {}, got {}", m_name, m_num_args.value(), args.size()));
ctx->report_error(std::format("Command {} called with the wrong number of arguments. Expected {}, got {}",
m_name,
m_num_args.value(),
args.size()));
return;
}
@ -51,7 +55,9 @@ namespace big
}
if (m_fiber_pool)
g_fiber_pool->queue_job([this, args, ctx] { execute(args, ctx); });
g_fiber_pool->queue_job([this, args, ctx] {
execute(args, ctx);
});
else
execute(args, ctx);
}
@ -60,7 +66,10 @@ namespace big
{
if (m_num_args.has_value() && args.size() != m_num_args.value())
{
ctx->report_error(std::format("Command {} called with the wrong number of arguments. Expected {}, got {}", m_name, m_num_args.value(), args.size()));
ctx->report_error(std::format("Command {} called with the wrong number of arguments. Expected {}, got {}",
m_name,
m_num_args.value(),
args.size()));
return;
}

View File

@ -1,8 +1,8 @@
#pragma once
#include "gta/joaat.hpp"
#include "core/enums.hpp"
#include "context/command_context.hpp"
#include "context/default_command_context.hpp"
#include "core/enums.hpp"
#include "gta/joaat.hpp"
namespace big
{
@ -16,14 +16,29 @@ namespace big
bool m_fiber_pool;
virtual void execute(const std::vector<std::uint64_t>& args, const std::shared_ptr<command_context> ctx = std::make_shared<default_command_context>()) = 0;
virtual std::optional<std::vector<std::uint64_t>> parse_args(const std::vector<std::string>& args, const std::shared_ptr<command_context> ctx = std::make_shared<default_command_context>()) { return std::vector<std::uint64_t>(); };
virtual CommandAccessLevel get_access_level() { return CommandAccessLevel::ADMIN; }
virtual std::optional<std::vector<std::uint64_t>> parse_args(const std::vector<std::string>& args, const std::shared_ptr<command_context> ctx = std::make_shared<default_command_context>())
{
return std::vector<std::uint64_t>();
};
virtual CommandAccessLevel get_access_level()
{
return CommandAccessLevel::ADMIN;
}
public:
command(const std::string& name, const std::string& label, const std::string& description, std::optional<std::uint8_t> num_args, bool fiber_pool = true);
inline const std::string& get_name() { return m_name; }
inline const std::string& get_label() { return m_label; }
inline const std::string& get_description() { return m_description; }
inline const std::string& get_name()
{
return m_name;
}
inline const std::string& get_label()
{
return m_label;
}
inline const std::string& get_description()
{
return m_description;
}
void call(const std::vector<std::uint64_t>& args, const std::shared_ptr<command_context> ctx = std::make_shared<default_command_context>());
void call(const std::vector<std::string>& args, const std::shared_ptr<command_context> ctx = std::make_shared<default_command_context>());

View File

@ -1,7 +1,7 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
#include <script/globals/GPBD_FM_3.hpp>
@ -19,12 +19,9 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
const size_t arg_count = 3;
int64_t args[arg_count] =
{
(int64_t)eRemoteEvent::NetworkBail,
int64_t args[arg_count] = {(int64_t)eRemoteEvent::NetworkBail,
(int64_t)self::id,
scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[player->id()].ScriptEventReplayProtectionCounter
};
scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[player->id()].ScriptEventReplayProtectionCounter};
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << player->id());
}

View File

@ -1,9 +1,9 @@
#include "backend/player_command.hpp"
#include "backend/bool_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "gta_util.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include <network/Network.hpp>
@ -38,8 +38,11 @@ namespace big
{
if (plyr->id() != player->id())
g_pointers->m_send_remove_gamer_cmd(gta_util::get_network()->m_game_session_ptr->m_net_connection_mgr,
g_pointers->m_get_connection_peer(gta_util::get_network()->m_game_session_ptr->m_net_connection_mgr, (int)plyr->get_session_player()->m_player_data.m_peer_id_2),
gta_util::get_network()->m_game_session_ptr->m_connection_identifier, &cmd, 0x1000000);
g_pointers->m_get_connection_peer(gta_util::get_network()->m_game_session_ptr->m_net_connection_mgr,
(int)plyr->get_session_player()->m_player_data.m_peer_id_2),
gta_util::get_network()->m_game_session_ptr->m_connection_identifier,
&cmd,
0x1000000);
}
g_pointers->m_handle_remove_gamer_cmd(gta_util::get_network()->m_game_session_ptr, player->get_session_player(), &cmd);
@ -51,8 +54,11 @@ namespace big
if (plyr->is_host())
{
g_pointers->m_send_remove_gamer_cmd(gta_util::get_network()->m_game_session_ptr->m_net_connection_mgr,
g_pointers->m_get_connection_peer(gta_util::get_network()->m_game_session_ptr->m_net_connection_mgr, (int)plyr->get_session_player()->m_player_data.m_peer_id_2),
gta_util::get_network()->m_game_session_ptr->m_connection_identifier, &cmd, 0x1000000);
g_pointers->m_get_connection_peer(gta_util::get_network()->m_game_session_ptr->m_net_connection_mgr,
(int)plyr->get_session_player()->m_player_data.m_peer_id_2),
gta_util::get_network()->m_game_session_ptr->m_connection_identifier,
&cmd,
0x1000000);
break;
}
@ -62,5 +68,6 @@ namespace big
};
breakup_kick g_breakup_kick("breakup", "Breakup Kick", "Nearly unblockable but could be detected by others", 0, false);
bool_command g_show_cheating_message("breakupcheating", "Show Cheating Message", "Shows a \"was detected cheating and has been removed from the session\" instead of the usual leave message when the player gets kicked", g.session.show_cheating_message);
bool_command g_show_cheating_message("breakupcheating", "Show Cheating Message", "Shows a \"was detected cheating and has been removed from the session\" instead of the usual leave message when the player gets kicked",
g.session.show_cheating_message);
}

View File

@ -1,8 +1,8 @@
#include "backend/player_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
#include "gta_util.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include <network/Network.hpp>

View File

@ -1,7 +1,7 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
#include "util/scripts.hpp"
namespace big

View File

@ -1,9 +1,9 @@
#include "backend/player_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
#include "packet.hpp"
#include "gta_util.hpp"
#include "natives.hpp"
#include "packet.hpp"
#include "pointers.hpp"
#include <network/Network.hpp>

View File

@ -1,7 +1,7 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
namespace big
{
@ -17,12 +17,7 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
const size_t arg_count = 15;
int64_t args[arg_count] =
{
(int64_t)eRemoteEvent::InteriorControl,
(int64_t)self::id,
(int64_t)(int)-1
};
int64_t args[arg_count] = {(int64_t)eRemoteEvent::InteriorControl, (int64_t)self::id, (int64_t)(int)-1};
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << player->id());
}

View File

@ -1,9 +1,9 @@
#include "backend/player_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
#include "util/scripts.hpp"
#include "natives.hpp"
#include "packet.hpp"
#include "pointers.hpp"
#include "util/scripts.hpp"
namespace big
{

View File

@ -1,7 +1,7 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
#include "util/scripts.hpp"
namespace big

View File

@ -1,11 +1,11 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
#include "util/misc.hpp"
#include <script/globals/GlobalPlayerBD.hpp>
#include <script/globals/GPBD_FM.hpp>
#include <script/globals/GlobalPlayerBD.hpp>
namespace big
{
@ -19,21 +19,27 @@ namespace big
if (scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].PropertyData.Index != -1)
{
const size_t arg_count = 9;
int64_t args[arg_count] = {
(int64_t)eRemoteEvent::Teleport,
int64_t args[arg_count] = {(int64_t)eRemoteEvent::Teleport,
self::id,
(int64_t)player->id(),
(int64_t)(int)-1, 1, (int64_t)scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].PropertyData.Index, 1, 0, 1
};
(int64_t)(int)-1,
1,
(int64_t)scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].PropertyData.Index,
1,
0,
1};
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << self::id);
}
else if (scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[id].SimpleInteriorData.Index != eSimpleInteriorIndex::SIMPLE_INTERIOR_INVALID)
{
*script_global(1950108).at(3346).as<Player*>() = scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[id].SimpleInteriorData.Owner;
*script_global(1950108).at(3683).as<eSimpleInteriorIndex*>() = scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[id].SimpleInteriorData.Index;
*script_global(1950108).at(3346).as<Player*>() =
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[id].SimpleInteriorData.Owner;
*script_global(1950108).at(3683).as<eSimpleInteriorIndex*>() =
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[id].SimpleInteriorData.Index;
*script_global(1950108).at(3682).as<bool*>() = true;
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].SimpleInteriorData.InteriorSubtype = scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[id].SimpleInteriorData.InteriorSubtype;
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].SimpleInteriorData.InteriorSubtype =
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[id].SimpleInteriorData.InteriorSubtype;
}
else
{

View File

@ -1,8 +1,8 @@
#include "backend/player_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/globals.hpp"
#include "services/pickups/pickup_service.hpp"
#include "util/globals.hpp"
namespace big
{

View File

@ -1,8 +1,8 @@
#include "backend/player_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/globals.hpp"
#include "services/pickups/pickup_service.hpp"
#include "util/globals.hpp"
namespace big
{

View File

@ -1,8 +1,8 @@
#include "backend/player_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/globals.hpp"
#include "services/pickups/pickup_service.hpp"
#include "util/globals.hpp"
namespace big
{

View File

@ -1,7 +1,7 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
#include "script_function.hpp"
namespace big

View File

@ -11,9 +11,7 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
ped::steal_identity(
PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id())
);
ped::steal_identity(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()));
}
};

View File

@ -11,9 +11,7 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
ped::steal_outfit(
PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id())
);
ped::steal_outfit(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()));
}
};

View File

@ -1,7 +1,7 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
namespace big
{
@ -24,10 +24,7 @@ namespace big
else if (leader == player->id())
{
const size_t arg_count = 2;
int64_t args[arg_count] = {
(int64_t)eRemoteEvent::CeoKick,
(int64_t)self::id
};
int64_t args[arg_count] = {(int64_t)eRemoteEvent::CeoKick, (int64_t)self::id};
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << player->id());
return;
@ -36,11 +33,7 @@ namespace big
{
// use a more private method to remove associate
const size_t arg_count = 3;
int64_t args[arg_count] = {
(int64_t)eRemoteEvent::MarkPlayerAsBeast,
(int64_t)self::id,
leader
};
int64_t args[arg_count] = {(int64_t)eRemoteEvent::MarkPlayerAsBeast, (int64_t)self::id, leader};
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << player->id());
}

View File

@ -1,7 +1,7 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
namespace big
{
@ -17,12 +17,7 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
const size_t arg_count = 3;
int64_t args[arg_count] =
{
(int64_t)eRemoteEvent::ForceMission,
(int64_t)self::id,
0
};
int64_t args[arg_count] = {(int64_t)eRemoteEvent::ForceMission, (int64_t)self::id, 0};
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << player->id());
}

View File

@ -1,8 +1,8 @@
#include "backend/player_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "services/gta_data/gta_data_service.hpp"
#include "script.hpp"
#include "services/gta_data/gta_data_service.hpp"
namespace big
{

View File

@ -1,11 +1,11 @@
#include "hooking.hpp"
#include "backend/player_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "gta/net_object_mgr.hpp"
#include "core/scr_globals.hpp"
#include "fiber_pool.hpp"
#include "gta/net_object_mgr.hpp"
#include "gta/script_handler.hpp"
#include "hooking.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/scripts.hpp"
#include <script/globals/GPBD_FM.hpp>
@ -26,8 +26,7 @@ namespace big
if (scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[player->id()].PropertyData.Index != -1)
{
int id = player->id();
g_fiber_pool->queue_job([id]
{
g_fiber_pool->queue_job([id] {
int instance = -1;
for (int i = 0; i < 32; i++)
@ -66,9 +65,9 @@ namespace big
script->m_context.m_state = rage::eThreadState::unk_3;
gta_util::execute_as_script(script, [instance]
{
if (auto hook = g_hooking->m_handler_hooks[(CGameScriptHandler*)rage::scrThread::get()->m_handler].get())
gta_util::execute_as_script(script, [instance] {
if (auto hook =
g_hooking->m_handler_hooks[(CGameScriptHandler*)rage::scrThread::get()->m_handler].get())
{
hook->disable();
g_hooking->m_handler_hooks.erase((CGameScriptHandler*)rage::scrThread::get()->m_handler);
@ -80,7 +79,9 @@ namespace big
for (int i = 0; i < 100; i++)
{
int status = 0;
gta_util::execute_as_script(script, [&status] { status = NETWORK::NETWORK_GET_SCRIPT_STATUS(); });
gta_util::execute_as_script(script, [&status] {
status = NETWORK::NETWORK_GET_SCRIPT_STATUS();
});
if (status == 2)
break;
@ -97,8 +98,7 @@ namespace big
static uint64_t server_vars[1358]{};
static uint64_t client_vars[1185]{};
gta_util::execute_as_script(script, []
{
gta_util::execute_as_script(script, [] {
NETWORK::NETWORK_REGISTER_HOST_BROADCAST_VARIABLES((int*)server_vars, 1358, 0);
NETWORK::NETWORK_REGISTER_PLAYER_BROADCAST_VARIABLES((int*)client_vars, 1185, 0);
});
@ -106,7 +106,9 @@ namespace big
for (int i = 0; i < 3600; i++)
{
bool received = false;
gta_util::execute_as_script(script, [&received] { received = NETWORK::NETWORK_HAS_RECEIVED_HOST_BROADCAST_DATA(); });
gta_util::execute_as_script(script, [&received] {
received = NETWORK::NETWORK_HAS_RECEIVED_HOST_BROADCAST_DATA();
});
if (received)
break;
@ -138,7 +140,6 @@ namespace big
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << player->id());
}
}
};

View File

@ -1,7 +1,7 @@
#include "backend/player_command.hpp"
#include "gta/net_object_mgr.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "gta/net_object_mgr.hpp"
namespace big
{
@ -22,10 +22,7 @@ namespace big
{
// vehicle hasn't synced yet, use TSE
const size_t arg_count = 9;
int64_t args[arg_count] = {
(int64_t)eRemoteEvent::VehicleKick,
self::id, 0, 0, 0, 0, 0, 0, 0
};
int64_t args[arg_count] = {(int64_t)eRemoteEvent::VehicleKick, self::id, 0, 0, 0, 0, 0, 0, 0};
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << player->id());
}

View File

@ -18,8 +18,24 @@ namespace big
if (!player->get_ped())
return;
g_pointers->m_send_network_damage((CEntity*)g_player_service->get_self()->get_ped(), (CEntity*)player->get_ped(), player->get_ped()->m_navigation->get_position(),
0, true, RAGE_JOAAT("weapon_explosion"), 10000.0f, 2, 0, (1 << 4), 0, 0, 0, false, false, true, true, nullptr);
g_pointers->m_send_network_damage((CEntity*)g_player_service->get_self()->get_ped(),
(CEntity*)player->get_ped(),
player->get_ped()->m_navigation->get_position(),
0,
true,
RAGE_JOAAT("weapon_explosion"),
10000.0f,
2,
0,
(1 << 4),
0,
0,
0,
false,
false,
true,
true,
nullptr);
}
};

View File

@ -1,7 +1,7 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
#include <script/globals/GPBD_FM_3.hpp>
@ -19,11 +19,7 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
const size_t arg_count = 8;
int64_t args[arg_count] =
{
(int64_t)eRemoteEvent::SendTextLabelSMS,
self::id
};
int64_t args[arg_count] = {(int64_t)eRemoteEvent::SendTextLabelSMS, self::id};
strcpy((char*)&args[2], "HUD_ROSBANPERM");

View File

@ -1,20 +1,13 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
#include <script/globals/GPBD_FM_3.hpp>
namespace big
{
static constexpr auto strippers = std::to_array({
"HCH",
"INF",
"JUL",
"NIK",
"SAP",
"TXI"
});
static constexpr auto strippers = std::to_array({"HCH", "INF", "JUL", "NIK", "SAP", "TXI"});
static constexpr auto sext_types = std::to_array({"1ST", "2ND", "NEED"});
@ -30,13 +23,11 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
const size_t arg_count = 8;
int64_t args[arg_count] =
{
(int64_t)eRemoteEvent::SendTextLabelSMS,
self::id
};
int64_t args[arg_count] = {(int64_t)eRemoteEvent::SendTextLabelSMS, self::id};
strcpy((char*)&args[2], (std::string("SXT_") + strippers[rand() % strippers.size()] + "_" + sext_types[rand() % sext_types.size()]).data());
strcpy((char*)&args[2],
(std::string("SXT_") + strippers[rand() % strippers.size()] + "_" + sext_types[rand() % sext_types.size()])
.data());
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << player->id());
}
};

View File

@ -1,7 +1,7 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
namespace big
{
@ -22,12 +22,7 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
const size_t arg_count = 9;
int64_t args[arg_count] = {
(int64_t)eRemoteEvent::Teleport,
self::id,
(int64_t)player->id(),
(int64_t)(int)-1, 1, (int64_t)_args[0], 1, 1, 1
};
int64_t args[arg_count] = {(int64_t)eRemoteEvent::Teleport, self::id, (int64_t)player->id(), (int64_t)(int)-1, 1, (int64_t)_args[0], 1, 1, 1};
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << player->id());
}

View File

@ -23,9 +23,7 @@ namespace big
float max = 1e+38f;
auto coords = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()), FALSE);
const size_t arg_count = 15;
int64_t args[arg_count] =
{
(int64_t)eRemoteEvent::InteriorControl,
int64_t args[arg_count] = {(int64_t)eRemoteEvent::InteriorControl,
(int64_t)self::id,
(int64_t)(int)_args[0],
(int64_t)self::id,
@ -39,8 +37,7 @@ namespace big
1,
(int64_t) * (uint32_t*)&max,
(int64_t) true,
-1
};
-1};
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << player->id());
}

View File

@ -1,7 +1,7 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
namespace big
{

View File

@ -1,7 +1,7 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
namespace big
{
@ -22,13 +22,7 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
const size_t arg_count = 6;
int64_t args[arg_count] = {
(int64_t)eRemoteEvent::TeleportToWarehouse,
self::id,
(int64_t)player->id(),
1,
(int64_t)_args[0]
};
int64_t args[arg_count] = {(int64_t)eRemoteEvent::TeleportToWarehouse, self::id, (int64_t)player->id(), 1, (int64_t)_args[0]};
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << player->id());
}

View File

@ -1,9 +1,9 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
#include "util/globals.hpp"
#include "script.hpp"
#include "util/globals.hpp"
#include <script/globals/GlobalPlayerBD.hpp>

View File

@ -1,7 +1,7 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
#include <script/globals/GPBD_FM_3.hpp>
@ -19,17 +19,14 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
const size_t arg_count = 8;
int64_t args[arg_count] =
{
(int64_t)eRemoteEvent::TransactionError,
int64_t args[arg_count] = {(int64_t)eRemoteEvent::TransactionError,
(int64_t)self::id,
1,
0,
0,
scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[player->id()].ScriptEventReplayProtectionCounter,
*scr_globals::gsbd_fm_events.at(9).as<int*>(),
*scr_globals::gsbd_fm_events.at(10).as<int*>()
};
*scr_globals::gsbd_fm_events.at(10).as<int*>()};
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << player->id());
}

View File

@ -1,10 +1,10 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "script.hpp"
#include <script/globals/GPBD_FM_3.hpp>
#include "core/scr_globals.hpp"
namespace big
{
@ -21,11 +21,7 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
const size_t arg_count = 25;
int64_t args[arg_count] =
{
(int64_t)eRemoteEvent::StartScriptBegin,
(int64_t)self::id
};
int64_t args[arg_count] = {(int64_t)eRemoteEvent::StartScriptBegin, (int64_t)self::id};
args[2] = scriptId;
strcpy((char*)&args[2 + 3], "0");
@ -39,11 +35,7 @@ namespace big
for (int i = 0; i < 2; i++)
{
const size_t arg_count_2 = 25;
int64_t args_2[arg_count_2] =
{
(int64_t)eRemoteEvent::StartScriptProceed,
(int64_t)self::id
};
int64_t args_2[arg_count_2] = {(int64_t)eRemoteEvent::StartScriptProceed, (int64_t)self::id};
args_2[2 + 17] = 1337;
g_pointers->m_trigger_script_event(1, args_2, arg_count_2, 1 << player->id());

View File

@ -16,12 +16,7 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
const size_t arg_count = 3;
int64_t args[arg_count] =
{
(int64_t)eRemoteEvent::TriggerCEORaid,
(int64_t)self::id,
0
};
int64_t args[arg_count] = {(int64_t)eRemoteEvent::TriggerCEORaid, (int64_t)self::id, 0};
g_pointers->m_trigger_script_event(1, args, arg_count, 1 << player->id());
}

View File

@ -1,7 +1,7 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "core/scr_globals.hpp"
#include "util/scripts.hpp"
namespace big

View File

@ -1,5 +1,5 @@
#include "backend/player_command.hpp"
#include "backend/bool_command.hpp"
#include "backend/player_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/troll.hpp"
@ -17,5 +17,6 @@ namespace big
};
set_bounty g_bounty("bounty", "Bounty", "Sets a 10k bounty on the player", 0);
bool_command g_anonymous_bounty("anonbounty", "Anonymous Bounty", "Don't show your name when setting a bounty on someone", g.session.anonymous_bounty);
bool_command g_anonymous_bounty("anonbounty", "Anonymous Bounty", "Don't show your name when setting a bounty on someone",
g.session.anonymous_bounty);
}

View File

@ -1,7 +1,8 @@
#include "util/teleport.hpp"
#include "backend/player_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/teleport.hpp"
namespace big
{

View File

@ -11,7 +11,8 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player_service->get_selected()->id()), false);
Vehicle veh =
PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player_service->get_selected()->id()), false);
teleport::into_vehicle(veh);
}

View File

@ -1,5 +1,5 @@
#include "backend/command.hpp"
#include "backend/bool_command.hpp"
#include "backend/command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/vehicle.hpp"
@ -29,7 +29,9 @@ namespace big
return;
}
const auto spawn_location = vehicle::get_spawn_location(ctx->get_sender()->id() == self::id ? g.spawn_vehicle.spawn_inside : false, PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(ctx->get_sender()->id()));
const auto spawn_location =
vehicle::get_spawn_location(ctx->get_sender()->id() == self::id ? g.spawn_vehicle.spawn_inside : false,
PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(ctx->get_sender()->id()));
const auto spawn_heading = ENTITY::GET_ENTITY_HEADING(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(ctx->get_sender()->id()));
const auto veh = vehicle::spawn(args[0], spawn_location, spawn_heading);
@ -54,6 +56,8 @@ namespace big
};
spawn_vehicle g_spawn_vehicle("spawn", "Spawn Vehicle", "Spawn a vehicle with the specified model", 1);
bool_command g_spawn_maxed("spawnmaxed", "Spawn Maxed", "Controls whether the vehicle spawned will have its mods maxed out", g.spawn_vehicle.spawn_maxed);
bool_command g_spawn_inside("spawnin", "Spawn Inside", "Controls whether the player should be set inside the vehicle after it spawns", g.spawn_vehicle.spawn_inside);
bool_command g_spawn_maxed("spawnmaxed", "Spawn Maxed", "Controls whether the vehicle spawned will have its mods maxed out",
g.spawn_vehicle.spawn_maxed);
bool_command g_spawn_inside("spawnin", "Spawn Inside", "Controls whether the player should be set inside the vehicle after it spawns",
g.spawn_vehicle.spawn_inside);
}

View File

@ -1,7 +1,7 @@
#include "backend/command.hpp"
#include "natives.hpp"
#include "util/vehicle.hpp"
#include "util/mobile.hpp"
#include "util/vehicle.hpp"
namespace big
{

View File

@ -1,7 +1,7 @@
#include "backend/command.hpp"
#include "natives.hpp"
#include "util/vehicle.hpp"
#include "util/mobile.hpp"
#include "util/vehicle.hpp"
namespace big
{

View File

@ -1,7 +1,7 @@
#include "backend/command.hpp"
#include "natives.hpp"
#include "util/vehicle.hpp"
#include "util/mobile.hpp"
#include "util/vehicle.hpp"
namespace big
{

View File

@ -1,6 +1,7 @@
#include "chat_command_context.hpp"
#include "util/notify.hpp"
#include "hooking.hpp"
#include "util/notify.hpp"
namespace big
{
@ -24,14 +25,16 @@ namespace big
void chat_command_context::report_output(const std::string& output) const
{
g_fiber_pool->queue_job([this, output]
{
g_fiber_pool->queue_job([this, output] {
char msg[265]{};
msg[0] = g.session.chat_output_prefix;
msg[1] = ' ';
strncpy(msg + 2, output.c_str(), sizeof(msg) - 2);
if (g_hooking->get_original<hooks::send_chat_message>()(*g_pointers->m_send_chat_ptr, g_player_service->get_self()->get_net_data(), msg, false))
if (g_hooking->get_original<hooks::send_chat_message>()(*g_pointers->m_send_chat_ptr,
g_player_service->get_self()->get_net_data(),
msg,
false))
notify::draw_chat(msg, g_player_service->get_self()->get_name(), false);
});
}

View File

@ -6,6 +6,7 @@ namespace big
class chat_command_context : public command_context
{
player_ptr m_player;
public:
virtual player_ptr get_sender() const override;
virtual CommandAccessLevel get_access_level() const override;

View File

@ -1,6 +1,6 @@
#pragma once
#include "services/players/player_service.hpp"
#include "core/enums.hpp"
#include "services/players/player_service.hpp"
namespace big
{

View File

@ -12,8 +12,12 @@ namespace big
virtual void execute(const std::vector<std::uint64_t>& args, const std::shared_ptr<command_context> ctx = std::make_shared<default_command_context>()) override;
virtual std::optional<std::vector<std::uint64_t>> parse_args(const std::vector<std::string>& args, const std::shared_ptr<command_context> ctx = std::make_shared<default_command_context>()) override;
public:
int_command(const std::string& name, const std::string& label, const std::string& description, int& value, int lower_bound, int upper_bound);
inline int& get_value() { return m_value; }
inline int& get_value()
{
return m_value;
}
};
}

View File

@ -1,86 +1,14 @@
#include "backend/looped/looped.hpp"
#include "core/scr_globals.hpp"
#include "gta/joaat.hpp"
#include "natives.hpp"
#include "script_global.hpp"
#include "gta/joaat.hpp"
#include "services/players/player_service.hpp"
#include "core/scr_globals.hpp"
// Credits: QuickNET
namespace big
{
constexpr char transition_states[][48] =
{
"TRANSITION_STATE_EMPTY",
"Singleplayer Swoop Up",
"Multiplayer Swoop Up",
"Creator Swoop Up",
"Pre-HUD Checks",
"Wait HUD Exit",
"Wait For Summon",
"Singleplayer Swoop Down",
"Multiplayer Swoop Down",
"Cancel Joining",
"Retry Loading",
"Retry Loading Slot 1",
"Retry Loading Slot 2",
"Retry Loading Slot 3",
"Retry Loading Slot 4",
"Wait On Invite",
"Prejoining Freemode Session Checks",
"Look For Fresh Join Freemode",
"Look To Join Another Session Freemode",
"Confirm Freemode Session Joining",
"Wait Join Freemode Session",
"Creation Enter Session",
"Pre-Freemode Launch Script",
"Freemode Teamfull Check",
"Start Freemode Launch Script",
"Freemode Transition Create Player",
"Is Freemode And Transition Ready",
"Freemode Swoop Down",
"Post Bink Video Warp",
"Freemode Final Setup Player",
"Move Freemode To Running State",
"Freemode How To Terminate",
"Start Creator Pre-Launch Script Check",
"Start Creator Launch Script",
"Creator Transition Create Player",
"Is Creator And Transition Ready",
"Creator Swoop Down",
"Creator Final Setup Player",
"Move Creator To Running State",
"Prejoining Testbed Session Checks",
"Look For Fresh Join Testbed",
"Look For Fresh Host Testbed",
"Look To Join Another Session Testbed",
"Look To Host Session Testbed",
"Confirm Testbed Session Joining",
"Wait Join Testbed Session",
"Start Testbed Launch Script",
"Testbed Transition Create Player",
"Is Testbed And Transition Ready",
"Testbed Swoop Down",
"Testbed Final Setup Player",
"Move Testbed To Running State",
"Testbed How To Terminate",
"Quit Current Session Prompt",
"Wait For Transition Session To Setup",
"Terminate Singleplayer",
"Wait Terminate Singleplayer",
"Kick Terminate Session",
"Terminate Session",
"Wait Terminate Session",
"Terminate Session And Hold",
"Terminate Session And Move Into Holding State",
"Team Swapping Checks",
"Return To Singleplayer",
"Wait For Singleplayer To Start",
"Waiting For External Termination Call",
"Terminate Maintransition",
"Wait For Dirty Load Confirm",
"DLC Intro Bink",
"Spawn Into Personal Vehicle"
};
constexpr char transition_states[][48] = {"TRANSITION_STATE_EMPTY", "Singleplayer Swoop Up", "Multiplayer Swoop Up", "Creator Swoop Up", "Pre-HUD Checks", "Wait HUD Exit", "Wait For Summon", "Singleplayer Swoop Down", "Multiplayer Swoop Down", "Cancel Joining", "Retry Loading", "Retry Loading Slot 1", "Retry Loading Slot 2", "Retry Loading Slot 3", "Retry Loading Slot 4", "Wait On Invite", "Prejoining Freemode Session Checks", "Look For Fresh Join Freemode", "Look To Join Another Session Freemode", "Confirm Freemode Session Joining", "Wait Join Freemode Session", "Creation Enter Session", "Pre-Freemode Launch Script", "Freemode Teamfull Check", "Start Freemode Launch Script", "Freemode Transition Create Player", "Is Freemode And Transition Ready", "Freemode Swoop Down", "Post Bink Video Warp", "Freemode Final Setup Player", "Move Freemode To Running State", "Freemode How To Terminate", "Start Creator Pre-Launch Script Check", "Start Creator Launch Script", "Creator Transition Create Player", "Is Creator And Transition Ready", "Creator Swoop Down", "Creator Final Setup Player", "Move Creator To Running State", "Prejoining Testbed Session Checks", "Look For Fresh Join Testbed", "Look For Fresh Host Testbed", "Look To Join Another Session Testbed", "Look To Host Session Testbed", "Confirm Testbed Session Joining", "Wait Join Testbed Session", "Start Testbed Launch Script", "Testbed Transition Create Player", "Is Testbed And Transition Ready", "Testbed Swoop Down", "Testbed Final Setup Player", "Move Testbed To Running State", "Testbed How To Terminate", "Quit Current Session Prompt", "Wait For Transition Session To Setup", "Terminate Singleplayer", "Wait Terminate Singleplayer", "Kick Terminate Session", "Terminate Session", "Wait Terminate Session", "Terminate Session And Hold", "Terminate Session And Move Into Holding State", "Team Swapping Checks", "Return To Singleplayer", "Wait For Singleplayer To Start", "Waiting For External Termination Call", "Terminate Maintransition", "Wait For Dirty Load Confirm", "DLC Intro Bink", "Spawn Into Personal Vehicle"};
eTransitionState last_state = eTransitionState::TRANSITION_STATE_EMPTY;
void looped::hud_transition_state()
@ -91,15 +19,12 @@ namespace big
return;
// When freemode script loaded remove loading screen.
if (state == eTransitionState::TRANSITION_STATE_WAIT_JOIN_FM_SESSION
&& DLC::GET_IS_LOADING_SCREEN_ACTIVE())
if (state == eTransitionState::TRANSITION_STATE_WAIT_JOIN_FM_SESSION && DLC::GET_IS_LOADING_SCREEN_ACTIVE())
{
SCRIPT::SHUTDOWN_LOADING_SCREEN();
}
if (last_state == state
|| state == eTransitionState::TRANSITION_STATE_EMPTY
|| state > eTransitionState::TRANSITION_STATE_SPAWN_INTO_PERSONAL_VEHICLE)
if (last_state == state || state == eTransitionState::TRANSITION_STATE_EMPTY || state > eTransitionState::TRANSITION_STATE_SPAWN_INTO_PERSONAL_VEHICLE)
{
return;
}

View File

@ -1,5 +1,5 @@
#include "gta/pickup_rewards.hpp"
#include "backend/looped/looped.hpp"
#include "gta/pickup_rewards.hpp"
#include "services/players/player_service.hpp"
#include "util/globals.hpp"
#include "util/misc.hpp"
@ -22,15 +22,14 @@ namespace big
if (neverWantedPlayer > 32)
neverWantedPlayer = 0;
g_player_service->iterate([](const player_entry& entry)
{
g_player_service->iterate([](const player_entry& entry) {
if ((g.session.off_radar_all || entry.second->off_radar) && offRadarPlayer == entry.second->id())
globals::give_remote_otr(entry.second->id());
});
g_player_service->iterate([](const player_entry& entry)
{
if ((g.session.never_wanted_all || entry.second->never_wanted) && PLAYER::GET_PLAYER_WANTED_LEVEL(entry.second->id()) > 0 && neverWantedPlayer == entry.second->id())
g_player_service->iterate([](const player_entry& entry) {
if ((g.session.never_wanted_all || entry.second->never_wanted)
&& PLAYER::GET_PLAYER_WANTED_LEVEL(entry.second->id()) > 0 && neverWantedPlayer == entry.second->id())
globals::clear_wanted_player(entry.second->id());
});
@ -41,8 +40,7 @@ namespace big
}
else
{
g_player_service->iterate([](const player_entry& entry)
{
g_player_service->iterate([](const player_entry& entry) {
if (entry.second->semi_godmode)
{
if (CPed* ped = entry.second->get_ped())

View File

@ -1,8 +1,8 @@
#include "backend/looped/looped.hpp"
#include "pointers.hpp"
#include "natives.hpp"
#include "util/entity.hpp"
#include "fiber_pool.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/entity.hpp"
namespace big
{
@ -29,8 +29,7 @@ namespace big
{
auto controlled = g.m_remote_controlled_vehicle;
auto controller = g.m_remote_controller_vehicle;
g_fiber_pool->queue_job([controlled, controller]
{
g_fiber_pool->queue_job([controlled, controller] {
if (entity::take_control_of(controlled))
{
ENTITY::SET_ENTITY_COLLISION(g.m_remote_controlled_vehicle, TRUE, TRUE);

View File

@ -14,7 +14,8 @@ namespace big
if (!g_player_service->get_selected()->is_valid() || !g.player.spectating)
{
if (g.player.spectating) g.player.spectating = false;
if (g.player.spectating)
g.player.spectating = false;
if (!bReset)
{

View File

@ -1,5 +1,5 @@
#include "gta/pickup_rewards.hpp"
#include "backend/looped/looped.hpp"
#include "gta/pickup_rewards.hpp"
#include "services/players/player_service.hpp"
#include "util/globals.hpp"
#include "util/misc.hpp"
@ -14,13 +14,28 @@ namespace big
int rotate_cam_bits = 0;
g_player_service->iterate([&rotate_cam_bits](const player_entry& entry)
{
g_player_service->iterate([&rotate_cam_bits](const player_entry& entry) {
if (g_player_service->get_self()->get_ped() && entry.second->get_ped() && entry.second->get_ped()->m_health > 0)
{
if (entry.second->kill_loop && !(entry.second->get_ped()->m_damage_bits & (1 << 8)))
g_pointers->m_send_network_damage((CEntity*)g_player_service->get_self()->get_ped(), (CEntity*)entry.second->get_ped(), entry.second->get_ped()->m_navigation->get_position(),
0, true, RAGE_JOAAT("weapon_explosion"), 10000.0f, 2, 0, (1 << 4), 0, 0, 0, false, false, true, true, nullptr);
g_pointers->m_send_network_damage((CEntity*)g_player_service->get_self()->get_ped(),
(CEntity*)entry.second->get_ped(),
entry.second->get_ped()->m_navigation->get_position(),
0,
true,
RAGE_JOAAT("weapon_explosion"),
10000.0f,
2,
0,
(1 << 4),
0,
0,
0,
false,
false,
true,
true,
nullptr);
if (entry.second->explosion_loop)
toxic::blame_explode_player(entry.second, entry.second, EXP_TAG_SUBMARINE_BIG, 9999.0f, true, false, 9999.0f);
@ -38,12 +53,7 @@ namespace big
if (rotate_cam_bits)
{
const size_t arg_count = 3;
int64_t args[arg_count] =
{
(int64_t)eRemoteEvent::TSECommand,
(int64_t)self::id,
(int64_t)eRemoteEvent::TSECommandRotateCam
};
int64_t args[arg_count] = {(int64_t)eRemoteEvent::TSECommand, (int64_t)self::id, (int64_t)eRemoteEvent::TSECommandRotateCam};
g_pointers->m_trigger_script_event(1, args, arg_count, rotate_cam_bits);
}

View File

@ -1,6 +1,6 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
namespace big
{
@ -18,5 +18,6 @@ namespace big
}
};
beast_jump_looped g_beast_jump_looped("beastjump", "Beast Jump", "Allows you to jump as if you were the beast like in the Hunt the Beast event", g.self.beast_jump);
beast_jump_looped g_beast_jump_looped("beastjump", "Beast Jump", "Allows you to jump as if you were the beast like in the Hunt the Beast event",
g.self.beast_jump);
}

View File

@ -1,5 +1,5 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
#include "util/entity.hpp"
namespace big
@ -14,5 +14,6 @@ namespace big
}
};
clean_player_looped g_clean_player_looped("cleanloop", "Keep Player Clean", "Prevents wetness and decals from being applied on you", g.self.clean_player);
clean_player_looped g_clean_player_looped("cleanloop", "Keep Player Clean", "Prevents wetness and decals from being applied on you",
g.self.clean_player);
}

View File

@ -1,10 +1,10 @@
#include "backend/looped/looped.hpp"
#include "hooking.hpp"
#include "natives.hpp"
#include "util/entity.hpp"
#include "util/scripts.hpp"
#include "script_function.hpp"
#include "services/script_patcher/script_patcher_service.hpp"
#include "hooking.hpp"
#include "util/entity.hpp"
#include "util/scripts.hpp"
namespace big
{
@ -35,8 +35,7 @@ namespace big
g.m_dance_thread->m_context.m_state = rage::eThreadState::unk_3;
// perform initial setup
gta_util::execute_as_script(g.m_dance_thread, []
{
gta_util::execute_as_script(g.m_dance_thread, [] {
if (auto hook = g_hooking->m_handler_hooks[(CGameScriptHandler*)rage::scrThread::get()->m_handler].get())
{
hook->disable();

View File

@ -1,8 +1,8 @@
#include "backend/looped/looped.hpp"
#include "backend/looped_command.hpp"
#include "fiber_pool.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
#include "backend/looped_command.hpp"
namespace big
{

View File

@ -1,25 +1,13 @@
#include "backend/looped/looped.hpp"
#include "backend/looped_command.hpp"
#include "fiber_pool.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "util/math.hpp"
namespace big
{
static const ControllerInputs controls[] =
{
ControllerInputs::INPUT_LOOK_LR,
ControllerInputs::INPUT_LOOK_UD,
ControllerInputs::INPUT_LOOK_UP_ONLY,
ControllerInputs::INPUT_LOOK_DOWN_ONLY,
ControllerInputs::INPUT_LOOK_LEFT_ONLY,
ControllerInputs::INPUT_LOOK_RIGHT_ONLY,
ControllerInputs::INPUT_LOOK_LEFT,
ControllerInputs::INPUT_LOOK_RIGHT,
ControllerInputs::INPUT_LOOK_UP,
ControllerInputs::INPUT_LOOK_DOWN
};
static const ControllerInputs controls[] = {ControllerInputs::INPUT_LOOK_LR, ControllerInputs::INPUT_LOOK_UD, ControllerInputs::INPUT_LOOK_UP_ONLY, ControllerInputs::INPUT_LOOK_DOWN_ONLY, ControllerInputs::INPUT_LOOK_LEFT_ONLY, ControllerInputs::INPUT_LOOK_RIGHT_ONLY, ControllerInputs::INPUT_LOOK_LEFT, ControllerInputs::INPUT_LOOK_RIGHT, ControllerInputs::INPUT_LOOK_UP, ControllerInputs::INPUT_LOOK_DOWN};
class free_cam : looped_command
{

View File

@ -1,6 +1,6 @@
#include "backend/looped/looped.hpp"
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
namespace big
{

View File

@ -1,6 +1,6 @@
#include "backend/looped/looped.hpp"
#include "natives.hpp"
#include "core/data/hud_component_names.hpp"
#include "natives.hpp"
namespace big
{
@ -30,18 +30,16 @@ namespace big
HUD::DISPLAY_AMMO_THIS_FRAME(false);
}
if (bForceShowHUD) {
if (bForceShowHUD)
{
HUD::DISPLAY_HUD_WHEN_NOT_IN_STATE_OF_PLAY_THIS_FRAME();
HUD::DISPLAY_HUD_WHEN_PAUSED_THIS_FRAME();
}
if (
std::all_of(
std::begin(bHudComponents),
std::end(bHudComponents),
[](bool i) { return i; }
)
) {
if (std::all_of(std::begin(bHudComponents), std::end(bHudComponents), [](bool i) {
return i;
}))
{
HUD::DISPLAY_HUD(false);
bHasHUDBeenHidden = true;
}

View File

@ -1,9 +1,10 @@
#include "backend/looped/looped.hpp"
#include "backend/looped_command.hpp"
#include "core/scr_globals.hpp"
#include "fiber_pool.hpp"
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "services/script_patcher/script_patcher_service.hpp"
#include "core/scr_globals.hpp"
#include <script/globals/GlobalPlayerBD.hpp>
namespace big
@ -12,6 +13,11 @@ namespace big
{
using looped_command::looped_command;
virtual void on_enable() override
{
g_script_patcher_service->update();
}
virtual void on_tick() override
{
ENTITY::SET_ENTITY_VISIBLE(self::ped, false, 0);
@ -26,9 +32,11 @@ namespace big
{
ENTITY::SET_ENTITY_VISIBLE(self::ped, true, 0);
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].IsInvisible = false;
g_script_patcher_service->update();
}
};
invisibility g_invisibility("invis", "Invisiblity", "Makes you invisible", g.self.invisibility);
bool_command g_local_visibility("localvis", "Visible Locally", "Makes you visible to yourself, but other players would still not be able to see you", g.self.local_visibility);
bool_command g_local_visibility("localvis", "Visible Locally", "Makes you visible to yourself, but other players would still not be able to see you",
g.self.local_visibility);
}

View File

@ -1,5 +1,5 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
namespace big
{

View File

@ -1,7 +1,8 @@
#include "backend/looped/looped.hpp"
#include "backend/looped_command.hpp"
#include "fiber_pool.hpp"
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include <base/phArchetype.hpp>
#include <base/phBoundComposite.hpp>
@ -14,14 +15,19 @@ namespace big
virtual void on_tick() override
{
if (g_local_player)
((rage::phBoundComposite*)g_local_player->m_navigation->m_damp->m_bound)->m_bounds[0]->m_bounding_box_max_xyz_margin_w.w = -1;
((rage::phBoundComposite*)g_local_player->m_navigation->m_damp->m_bound)
->m_bounds[0]
->m_bounding_box_max_xyz_margin_w.w = -1;
}
virtual void on_disable() override
{
if (g_local_player)
((rage::phBoundComposite*)g_local_player->m_navigation->m_damp->m_bound)->m_bounds[0]->m_bounding_box_max_xyz_margin_w.w = 0.25;
((rage::phBoundComposite*)g_local_player->m_navigation->m_damp->m_bound)
->m_bounds[0]
->m_bounding_box_max_xyz_margin_w.w = 0.25;
}
};
no_collision g_no_collision("nocollision", "No Collision", "Allows you to walk through vehicles and most obstacles", g.self.no_collision);
no_collision
g_no_collision("nocollision", "No Collision", "Allows you to walk through vehicles and most obstacles", g.self.no_collision);
}

View File

@ -1,7 +1,7 @@
#include "backend/looped/looped.hpp"
#include "backend/looped_command.hpp"
#include "fiber_pool.hpp"
#include "natives.hpp"
#include "backend/looped_command.hpp"
namespace big
{

View File

@ -1,7 +1,7 @@
#include "backend/looped/looped.hpp"
#include "backend/looped_command.hpp"
#include "fiber_pool.hpp"
#include "natives.hpp"
#include "backend/looped_command.hpp"
namespace big
{
@ -22,5 +22,6 @@ namespace big
}
};
no_water_collision g_no_water_collision("walkunder", "Walk Underwater", "Allows you to walk and shoot underwater", g.self.no_water_collision);
no_water_collision
g_no_water_collision("walkunder", "Walk Underwater", "Allows you to walk and shoot underwater", g.self.no_water_collision);
}

View File

@ -1,21 +1,13 @@
#include "backend/looped/looped.hpp"
#include "backend/looped_command.hpp"
#include "fiber_pool.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
#include "util/entity.hpp"
#include "backend/looped_command.hpp"
namespace big
{
static constexpr ControllerInputs controls[] =
{
ControllerInputs::INPUT_SPRINT,
ControllerInputs::INPUT_MOVE_UP_ONLY,
ControllerInputs::INPUT_MOVE_DOWN_ONLY,
ControllerInputs::INPUT_MOVE_LEFT_ONLY,
ControllerInputs::INPUT_MOVE_RIGHT_ONLY,
ControllerInputs::INPUT_DUCK
};
static constexpr ControllerInputs controls[] = {ControllerInputs::INPUT_SPRINT, ControllerInputs::INPUT_MOVE_UP_ONLY, ControllerInputs::INPUT_MOVE_DOWN_ONLY, ControllerInputs::INPUT_MOVE_LEFT_ONLY, ControllerInputs::INPUT_MOVE_RIGHT_ONLY, ControllerInputs::INPUT_DUCK};
static constexpr float speed = 20.f;

View File

@ -1,6 +1,6 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
namespace big
{

View File

@ -1,6 +1,6 @@
#include "backend/looped/looped.hpp"
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
namespace big
{

View File

@ -5,7 +5,8 @@ namespace big
{
void looped::self_police()
{
if (g_local_player == nullptr || g_local_player->m_player_info == nullptr) return;
if (g_local_player == nullptr || g_local_player->m_player_info == nullptr)
return;
static bool bLast = false;

View File

@ -1,7 +1,7 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "gta/enums.hpp"
#include "core/data/ptfx_effects.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
namespace big
{
@ -10,20 +10,9 @@ namespace big
{
using looped_command::looped_command;
PedBones ptfx_ped_bones[5] = {
PedBones::SKEL_Head,
PedBones::SKEL_L_Hand,
PedBones::SKEL_R_Hand,
PedBones::SKEL_L_Foot,
PedBones::SKEL_R_Foot
};
PedBones ptfx_ped_bones[5] = {PedBones::SKEL_Head, PedBones::SKEL_L_Hand, PedBones::SKEL_R_Hand, PedBones::SKEL_L_Foot, PedBones::SKEL_R_Foot};
const char* ptfx_vehicle_pos[4] = {
"wheel_lf",
"wheel_lr",
"wheel_rf",
"wheel_rr"
};
const char* ptfx_vehicle_pos[4] = {"wheel_lf", "wheel_lr", "wheel_rf", "wheel_rr"};
void show_player_ptfx_effect(const char* fx_name, const char* name)
{
@ -31,7 +20,19 @@ namespace big
for (const auto& ptfx_bone : ptfx_ped_bones)
{
GRAPHICS::USE_PARTICLE_FX_ASSET(fx_name);
GRAPHICS::START_NETWORKED_PARTICLE_FX_NON_LOOPED_ON_PED_BONE(name, self::ped, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, (int)ptfx_bone, g.self.ptfx_effects.size, 1, 1, 1);
GRAPHICS::START_NETWORKED_PARTICLE_FX_NON_LOOPED_ON_PED_BONE(name,
self::ped,
0.f,
0.f,
0.f,
0.f,
0.f,
0.f,
(int)ptfx_bone,
g.self.ptfx_effects.size,
1,
1,
1);
STREAMING::REMOVE_PTFX_ASSET();
}
}
@ -42,7 +43,18 @@ namespace big
{
GRAPHICS::USE_PARTICLE_FX_ASSET(fx_name);
Vector3 bone_pos = ENTITY::GET_WORLD_POSITION_OF_ENTITY_BONE(self::veh, ENTITY::GET_ENTITY_BONE_INDEX_BY_NAME(self::veh, ptfx_bone));
GRAPHICS::START_NETWORKED_PARTICLE_FX_NON_LOOPED_AT_COORD(name, bone_pos.x, bone_pos.y, bone_pos.z, 0.f, 0.f, 0.f, g.self.ptfx_effects.size, 0.f, 0.f, 0.f, 0);
GRAPHICS::START_NETWORKED_PARTICLE_FX_NON_LOOPED_AT_COORD(name,
bone_pos.x,
bone_pos.y,
bone_pos.z,
0.f,
0.f,
0.f,
g.self.ptfx_effects.size,
0.f,
0.f,
0.f,
0);
}
}

View File

@ -1,6 +1,6 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
namespace big
{
@ -23,7 +23,6 @@ namespace big
{
WEAPON::SET_CURRENT_PED_WEAPON(self::ped, RAGE_JOAAT("WEAPON_UNARMED"), true);
}
}
};

View File

@ -1,6 +1,6 @@
#include "backend/looped_command.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "util/math.hpp"
namespace big

View File

@ -1,6 +1,6 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
namespace big
{
class superman : looped_command

View File

@ -1,5 +1,6 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
#include <ped/CPedIntelligence.hpp>
namespace big
@ -15,5 +16,6 @@ namespace big
}
};
unlimited_oxygen g_unlimited_oxygen("infoxy", "Unlimited Oxygen", "Allows you to stay underwater without losing oxygen", g.self.unlimited_oxygen);
unlimited_oxygen
g_unlimited_oxygen("infoxy", "Unlimited Oxygen", "Allows you to stay underwater without losing oxygen", g.self.unlimited_oxygen);
}

View File

@ -1,7 +1,7 @@
#include "backend/looped/looped.hpp"
#include "backend/player_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "backend/player_command.hpp"
namespace big
{
@ -11,8 +11,7 @@ namespace big
bool kick_host = *g_pointers->m_is_session_started && g.session.force_session_host && g.session.kick_host_when_forcing_host;
if (kick_host && !bLastKickHost)
{
g_player_service->iterate([](auto& plyr)
{
g_player_service->iterate([](auto& plyr) {
if (plyr.second->is_host())
{
((player_command*)(command::get(RAGE_JOAAT("lckick"))))->call(plyr.second, {});

View File

@ -1,9 +1,9 @@
#include "backend/looped/looped.hpp"
#include "core/scr_globals.hpp"
#include "gta_util.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "gta_util.hpp"
#include "script_local.hpp"
#include "core/scr_globals.hpp"
namespace big
{
@ -14,8 +14,7 @@ namespace big
bool used = g.session.block_jobs && *g_pointers->m_is_session_started;
if (!bLastBlockJobsEnabled && used)
{
if (!STREAMING::IS_PLAYER_SWITCH_IN_PROGRESS() && SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH(RAGE_JOAAT("maintransition")) == 0
&& NETWORK::NETWORK_GET_HOST_OF_SCRIPT("fmmc_launcher", -1, 0) == self::id)
if (!STREAMING::IS_PLAYER_SWITCH_IN_PROGRESS() && SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH(RAGE_JOAAT("maintransition")) == 0 && NETWORK::NETWORK_GET_HOST_OF_SCRIPT("fmmc_launcher", -1, 0) == self::id)
{
auto fmmc = gta_util::find_script_thread(RAGE_JOAAT("fmmc_launcher"));
*script_local(fmmc->m_stack, scr_locals::fmmc_launcher::broadcast_idx).at(47).at(7).as<int*>() = (-1 & ~(1 << self::id));

View File

@ -1,7 +1,7 @@
#include "backend/looped/looped.hpp"
#include "gta_util.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "gta_util.hpp"
#include "util/session.hpp"
namespace big

View File

@ -11,11 +11,15 @@ namespace big
{
if (toggled)
{
NETWORK::NETWORK_GET_GLOBAL_MULTIPLAYER_CLOCK(&g.session.custom_time.hour, &g.session.custom_time.minute, &g.session.custom_time.second);
NETWORK::NETWORK_GET_GLOBAL_MULTIPLAYER_CLOCK(&g.session.custom_time.hour,
&g.session.custom_time.minute,
&g.session.custom_time.second);
toggled = false;
}
NETWORK::NETWORK_OVERRIDE_CLOCK_TIME(g.session.custom_time.hour, g.session.custom_time.minute, g.session.custom_time.second);
NETWORK::NETWORK_OVERRIDE_CLOCK_TIME(g.session.custom_time.hour,
g.session.custom_time.minute,
g.session.custom_time.second);
}
else
{

View File

@ -1,7 +1,7 @@
#include "backend/looped/looped.hpp"
#include "gta_util.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "gta_util.hpp"
namespace big
{
@ -17,9 +17,15 @@ namespace big
{
if (!STREAMING::IS_PLAYER_SWITCH_IN_PROGRESS() && gta_util::find_script_thread(RAGE_JOAAT("freemode")) && SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH(RAGE_JOAAT("maintransition")) == 0)
{
gta_util::execute_as_script(RAGE_JOAAT("freemode"), []
{
pop_multiplier_id = MISC::ADD_POP_MULTIPLIER_SPHERE(1.1f, 1.1f, 1.1f, 15000.0f, g.session.disable_peds ? 0.0f : 1.0f, g.session.disable_traffic ? 0.0f : 1.0f, false, true);
gta_util::execute_as_script(RAGE_JOAAT("freemode"), [] {
pop_multiplier_id = MISC::ADD_POP_MULTIPLIER_SPHERE(1.1f,
1.1f,
1.1f,
15000.0f,
g.session.disable_peds ? 0.0f : 1.0f,
g.session.disable_traffic ? 0.0f : 1.0f,
false,
true);
bLastBlockPeds = g.session.disable_peds;
bLastBlockVehs = g.session.disable_traffic;
@ -40,8 +46,7 @@ namespace big
{
if (gta_util::find_script_thread(RAGE_JOAAT("freemode")))
{
gta_util::execute_as_script(RAGE_JOAAT("freemode"), []
{
gta_util::execute_as_script(RAGE_JOAAT("freemode"), [] {
MISC::REMOVE_POP_MULTIPLIER_SPHERE(pop_multiplier_id, false);
});
}

View File

@ -1,9 +1,9 @@
#include "backend/looped/looped.hpp"
#include "gta/script_handler.hpp"
#include "gta_util.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "gta_util.hpp"
#include "util/session.hpp"
#include "gta/script_handler.hpp"
namespace big
{
@ -11,7 +11,8 @@ namespace big
{
if (g.session.randomize_ceo_colors && *g_pointers->m_is_session_started && !STREAMING::IS_PLAYER_SWITCH_IN_PROGRESS() && SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH(RAGE_JOAAT("maintransition")) == 0)
{
if (auto freemode = gta_util::find_script_thread(RAGE_JOAAT("freemode")); freemode && freemode->m_net_component && freemode->m_net_component->is_local_player_host())
if (auto freemode = gta_util::find_script_thread(RAGE_JOAAT("freemode"));
freemode && freemode->m_net_component && freemode->m_net_component->is_local_player_host())
{
for (int i = 0; i < *scr_globals::gsbd.at(818).at(44).as<int*>(); i++)
{

View File

@ -1,5 +1,5 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
#include "util/teleport.hpp"
namespace big
@ -18,5 +18,6 @@ namespace big
}
};
auto_tp_to_waypoint g_auto_tp_to_waypoint("autotptowp", "Auto-Teleport To Waypoint", "Automatically teleports you to a waypoint as soon as you set one.", g.self.auto_tp);
auto_tp_to_waypoint g_auto_tp_to_waypoint("autotptowp", "Auto-Teleport To Waypoint", "Automatically teleports you to a waypoint as soon as you set one.",
g.self.auto_tp);
}

View File

@ -1,9 +1,10 @@
#include "backend/looped/looped.hpp"
#include "fiber_pool.hpp"
#include "gta_util.hpp"
#include "natives.hpp"
#include "script.hpp"
#include "services/players/player_service.hpp"
#include "gta_util.hpp"
#include <network/Network.hpp>
namespace big
@ -17,12 +18,14 @@ namespace big
return;
memset(&gta_util::get_network()->m_game_complaint_mgr.m_host_tokens_complained, 0, 64 * sizeof(std::uint64_t));
if (!g_player_service->m_player_to_use_complaint_kick || !g_player_service->m_player_to_use_complaint_kick->get()->get_net_data())
if (!g_player_service->m_player_to_use_complaint_kick
|| !g_player_service->m_player_to_use_complaint_kick->get()->get_net_data())
gta_util::get_network()->m_game_complaint_mgr.m_num_tokens_complained = 0;
else
{
gta_util::get_network()->m_game_complaint_mgr.m_num_tokens_complained = 1;
gta_util::get_network()->m_game_complaint_mgr.m_host_tokens_complained[0] = g_player_service->m_player_to_use_complaint_kick->get()->get_net_data()->m_host_token;
gta_util::get_network()->m_game_complaint_mgr.m_host_tokens_complained[0] =
g_player_service->m_player_to_use_complaint_kick->get()->get_net_data()->m_host_token;
}
auto old = gta_util::get_network()->m_game_complaint_mgr.m_host_token;
@ -40,7 +43,8 @@ namespace big
if (g_player_service->get_self() && g_player_service->get_self()->get_net_data())
{
gta_util::get_network()->m_game_complaint_mgr.m_host_token = g_player_service->get_self()->get_net_data()->m_host_token;
gta_util::get_network()->m_game_complaint_mgr.m_host_token =
g_player_service->get_self()->get_net_data()->m_host_token;
g_pointers->m_reset_network_complaints(&gta_util::get_network()->m_game_complaint_mgr);
}
}

View File

@ -1,9 +1,9 @@
#include "backend/looped/looped.hpp"
#include "core/scr_globals.hpp"
#include "fiber_pool.hpp"
#include "gta_util.hpp"
#include "natives.hpp"
#include "script.hpp"
#include "gta_util.hpp"
#include "core/scr_globals.hpp"
namespace big
{

View File

@ -1,11 +1,18 @@
#include "backend/looped/looped.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include <network/CNetworkPlayerMgr.hpp>
namespace big
{
void looped::system_self_globals()
{
self::id = PLAYER::PLAYER_ID();
if (!*g_pointers->m_network_player_mgr || !(*g_pointers->m_network_player_mgr)->m_local_net_player
|| (*g_pointers->m_network_player_mgr)->m_local_net_player->m_player_id == -1)
self::id = 0;
else
self::id = (*g_pointers->m_network_player_mgr)->m_local_net_player->m_player_id;
self::ped = PLAYER::PLAYER_PED_ID();

View File

@ -1,7 +1,12 @@
#include "backend/looped/looped.hpp"
#include "core/scr_globals.hpp"
#include "gta_util.hpp"
#include <network/Network.hpp>
#include "natives.hpp"
#include <network/CCommunications.hpp>
#include <network/Network.hpp>
#include <script/globals/GPBD_FM.hpp>
#include <script/globals/GlobalPlayerBD.hpp>
namespace big
{
@ -29,5 +34,31 @@ namespace big
bLastForceHost = g.session.force_session_host;
}
if (*g_pointers->m_is_session_started)
{
gta_util::execute_as_script(RAGE_JOAAT("freemode"), [] {
if (NETWORK::NETWORK_GET_THIS_SCRIPT_IS_NETWORK_SCRIPT() && NETWORK::NETWORK_GET_SCRIPT_STATUS() == 2)
{
if (g.spoofing.spoof_rank)
scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[self::id].PlayerStats.Rank = g.spoofing.rank;
if (g.spoofing.spoof_job_points)
scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[self::id].JobPoints = g.spoofing.job_points;
if (g.spoofing.spoof_kd_ratio)
scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[self::id].PlayerStats.KdRatio = g.spoofing.kd_ratio;
if (g.spoofing.spoof_blip)
{
if (g.spoofing.blip_type == 0)// random
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].PlayerBlip.PlayerVehicleBlipType = (eBlipType)(rand() % 90);
else
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].PlayerBlip.PlayerVehicleBlipType =
(eBlipType)(g.spoofing.blip_type - 1);
}
}
});
}
}
}

View File

@ -1,6 +1,6 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
namespace big
{

View File

@ -9,10 +9,7 @@ namespace big
{
void looped::vehicle_auto_drive()
{
static std::map<AutoDriveStyle, int> driving_style_flags = {
{AutoDriveStyle::LAW_ABIDING, 443},
{AutoDriveStyle::THE_ROAD_IS_YOURS, 787004}
};
static std::map<AutoDriveStyle, int> driving_style_flags = {{AutoDriveStyle::LAW_ABIDING, 443}, {AutoDriveStyle::THE_ROAD_IS_YOURS, 787004}};
static int changing_driving_styles = false;
static AutoDriveDestination current_destination = AutoDriveDestination::STOPPED;
@ -34,10 +31,8 @@ namespace big
changing_driving_styles = false;
g_notification_service->push_warning("Warning", "Please be in a car first then try again.");
}
else if (
current_driving_flag != driving_style_flags[g.vehicle.auto_drive_style] ||
current_speed != g.vehicle.auto_drive_speed
) {
else if (current_driving_flag != driving_style_flags[g.vehicle.auto_drive_style] || current_speed != g.vehicle.auto_drive_speed)
{
current_driving_flag = driving_style_flags[g.vehicle.auto_drive_style];
current_speed = g.vehicle.auto_drive_speed;
changing_driving_styles = true;
@ -60,31 +55,16 @@ namespace big
does_waypoint_exist = blip::get_blip_location(waypoint, (int)BlipIcons::Waypoint);
}
if (
does_waypoint_exist &&
(
last_waypoint.x != waypoint.x ||
last_waypoint.y != waypoint.y ||
last_waypoint.z != waypoint.z
)
) {
if (does_waypoint_exist
&& (last_waypoint.x != waypoint.x || last_waypoint.y != waypoint.y || last_waypoint.z != waypoint.z))
{
changing_driving_styles = true;
}
bool interupted = (
PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_MOVE_LEFT_ONLY) ||
PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_MOVE_RIGHT_ONLY) ||
PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_ACCELERATE) ||
PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_BRAKE) ||
PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_EXIT) ||
PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_HANDBRAKE)
);
bool interupted = (PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_MOVE_LEFT_ONLY) || PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_MOVE_RIGHT_ONLY) || PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_ACCELERATE) || PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_BRAKE) || PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_EXIT) || PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_HANDBRAKE));
if (
current_destination == AutoDriveDestination::EMERGENCY_STOP ||
(to_waypoint && !does_waypoint_exist) ||
interupted
) {
if (current_destination == AutoDriveDestination::EMERGENCY_STOP || (to_waypoint && !does_waypoint_exist) || interupted)
{
TASK::CLEAR_PRIMARY_VEHICLE_TASK(self::veh);
TASK::CLEAR_PED_TASKS(self::ped);
@ -115,11 +95,7 @@ namespace big
if (to_waypoint)
{
TASK::TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE(
self::ped, self::veh,
waypoint.x, waypoint.y, waypoint.z, current_speed,
current_driving_flag, 20
);
TASK::TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE(self::ped, self::veh, waypoint.x, waypoint.y, waypoint.z, current_speed, current_driving_flag, 20);
}
else
{

View File

@ -1,6 +1,6 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
namespace big
{
@ -21,5 +21,6 @@ namespace big
}
};
block_homing g_block_homing("blockhoming", "Block Homing Missiles", "Prevents homing missiles from locking on to your vehicle", g.vehicle.block_homing);
block_homing g_block_homing("blockhoming", "Block Homing Missiles", "Prevents homing missiles from locking on to your vehicle",
g.vehicle.block_homing);
}

View File

@ -1,7 +1,7 @@
#include "backend/looped/looped.hpp"
#include "backend/looped_command.hpp"
#include "fiber_pool.hpp"
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "util/entity.hpp"
namespace big
@ -15,10 +15,14 @@ namespace big
void drive_on_water_hide_surface()
{
Object surface = OBJECT::GET_CLOSEST_OBJECT_OF_TYPE(
drive_on_water_last_loc.x, drive_on_water_last_loc.y, drive_on_water_last_loc.z,
4.0, drive_on_water_surface_hash, 0, 0, 1
);
Object surface = OBJECT::GET_CLOSEST_OBJECT_OF_TYPE(drive_on_water_last_loc.x,
drive_on_water_last_loc.y,
drive_on_water_last_loc.z,
4.0,
drive_on_water_surface_hash,
0,
0,
1);
if (surface)
{
@ -38,10 +42,14 @@ namespace big
WATER::SET_DEEP_OCEAN_SCALER(0);
if (location.z - height < 10 && WATER::GET_WATER_HEIGHT_NO_WAVES(location.x, location.y, location.z, &height) && self::veh)
{
Object surface = OBJECT::GET_CLOSEST_OBJECT_OF_TYPE(
drive_on_water_last_loc.x, drive_on_water_last_loc.y, drive_on_water_last_loc.z,
4.0, drive_on_water_surface_hash, 0, 0, 1
);
Object surface = OBJECT::GET_CLOSEST_OBJECT_OF_TYPE(drive_on_water_last_loc.x,
drive_on_water_last_loc.y,
drive_on_water_last_loc.z,
4.0,
drive_on_water_surface_hash,
0,
0,
1);
if (ENTITY::DOES_ENTITY_EXIST(surface) && height > -50.0f)
{
@ -49,11 +57,14 @@ namespace big
drive_on_water_last_loc = location;
drive_on_water_last_loc.z = height - 0.5f;
ENTITY::SET_ENTITY_COORDS(
surface,
drive_on_water_last_loc.x, drive_on_water_last_loc.y, drive_on_water_last_loc.z,
0, 0, 0, 0
);
ENTITY::SET_ENTITY_COORDS(surface,
drive_on_water_last_loc.x,
drive_on_water_last_loc.y,
drive_on_water_last_loc.z,
0,
0,
0,
0);
if (location.z < height - 2.f)
{
@ -71,11 +82,13 @@ namespace big
drive_on_water_last_loc = location;
drive_on_water_last_loc.z = height - 0.5f;
surface = OBJECT::CREATE_OBJECT(
drive_on_water_surface_hash,
drive_on_water_last_loc.x, drive_on_water_last_loc.y, drive_on_water_last_loc.z,
1, 1, 0
);
surface = OBJECT::CREATE_OBJECT(drive_on_water_surface_hash,
drive_on_water_last_loc.x,
drive_on_water_last_loc.y,
drive_on_water_last_loc.z,
1,
1,
0);
entity::take_control_of(surface);
ENTITY::FREEZE_ENTITY_POSITION(surface, 1);

View File

@ -109,7 +109,6 @@ namespace big
Vehicle vehicle = self::veh;
if (g.vehicle.fly.enabled)
{
last_fly_tick = true;
if (!vehicle)
@ -132,7 +131,6 @@ namespace big
entity::take_control_of(vehicle);
g_notification_service->push_warning("Warning", "Failed to take control of the vehicle.");
}
}
}
}

View File

@ -1,6 +1,6 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
namespace big
{
@ -31,8 +31,7 @@ namespace big
if (horn_boost_speed < horn_boost_speed_max)
horn_boost_speed += horn_boost_speed_increment;
const auto velocity =
ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(vehicle, 0.f, horn_boost_speed, 0.f) - ENTITY::GET_ENTITY_COORDS(vehicle, true);
const auto velocity = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(vehicle, 0.f, horn_boost_speed, 0.f) - ENTITY::GET_ENTITY_COORDS(vehicle, true);
ENTITY::SET_ENTITY_VELOCITY(vehicle, velocity.x, velocity.y, velocity.z);
}
else if (PAD::IS_CONTROL_JUST_RELEASED(0, (int)ControllerInputs::INPUT_VEH_HORN))

View File

@ -1,6 +1,6 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
namespace big
{
@ -18,5 +18,6 @@ namespace big
}
};
instant_brake g_instant_brake("instantbrake", "Instant Brake", "Makes your vehicle stop instantly when you press the brake", g.vehicle.instant_brake);
instant_brake g_instant_brake("instantbrake", "Instant Brake", "Makes your vehicle stop instantly when you press the brake",
g.vehicle.instant_brake);
}

View File

@ -1,7 +1,7 @@
#include "backend/looped/looped.hpp"
#include "backend/looped_command.hpp"
#include "fiber_pool.hpp"
#include "natives.hpp"
#include "backend/looped_command.hpp"
namespace big
{
@ -39,5 +39,6 @@ namespace big
};
vehinvisibility g_vehinvisibility("invisveh", "Vehicle Invisiblity", "Makes your car invisible", g.vehicle.vehinvisibility);
bool_command g_localveh_visibility("localinvisveh", "Visible Locally", "Makes your car visible to yourself, other players will still not be able to see it", g.vehicle.localveh_visibility);
bool_command g_localveh_visibility("localinvisveh", "Visible Locally", "Makes your car visible to yourself, other players will still not be able to see it",
g.vehicle.localveh_visibility);
}

View File

@ -1,5 +1,5 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
namespace big
{
@ -11,12 +11,11 @@ namespace big
{
auto model = ENTITY::GET_ENTITY_MODEL(self::veh);
if (ENTITY::IS_ENTITY_IN_AIR(self::veh) &&
(VEHICLE::IS_THIS_MODEL_A_CAR(model) ||
VEHICLE::IS_THIS_MODEL_A_BIKE(model)))
if (ENTITY::IS_ENTITY_IN_AIR(self::veh) && (VEHICLE::IS_THIS_MODEL_A_CAR(model) || VEHICLE::IS_THIS_MODEL_A_BIKE(model)))
VEHICLE::SET_VEHICLE_ON_GROUND_PROPERLY(self::veh, 5.0);
}
};
keep_on_ground g_keep_on_ground("keeponground", "Keep On Ground", "Makes it so your vehicle is always on the ground on all four wheels", g.vehicle.keep_on_ground);
keep_on_ground g_keep_on_ground("keeponground", "Keep On Ground", "Makes it so your vehicle is always on the ground on all four wheels",
g.vehicle.keep_on_ground);
}

View File

@ -1,5 +1,5 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
#include "util/vehicle.hpp"
namespace big
@ -15,5 +15,6 @@ namespace big
}
};
keep_vehicle_repaired g_keep_vehicle_repaired("keepfixed", "Keep Vehicle Repaired", "Keeps your vehicle free of wear and tear", g.vehicle.keep_vehicle_repaired);
keep_vehicle_repaired g_keep_vehicle_repaired("keepfixed", "Keep Vehicle Repaired", "Keeps your vehicle free of wear and tear",
g.vehicle.keep_vehicle_repaired);
}

View File

@ -14,17 +14,15 @@ namespace big
void looped::vehicle_ls_customs()
{
if (busy) return;
if (busy)
return;
busy = true;
constexpr int hash = RAGE_JOAAT("carmod_shop");
if (g.vehicle.ls_customs && g.vehicle.ls_customs == state)
{
if (
auto carmod_shop_thread = gta_util::find_script_thread(hash);
carmod_shop_thread &&
*script_local(carmod_shop_thread, CARMOD_SHOP_STRUCT).at(11).as<int*>() != 4
)
if (auto carmod_shop_thread = gta_util::find_script_thread(hash);
carmod_shop_thread && *script_local(carmod_shop_thread, CARMOD_SHOP_STRUCT).at(11).as<int*>() != 4)
{
g.vehicle.ls_customs = false;

View File

@ -1,5 +1,5 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
namespace big
{
@ -20,5 +20,6 @@ namespace big
}
};
no_vehicle_water_collision g_no_vehicle_water_collision("driveunder", "Drive Underwater", "Allows you to drive underwater", g.vehicle.no_water_collision);
no_vehicle_water_collision
g_no_vehicle_water_collision("driveunder", "Drive Underwater", "Allows you to drive underwater", g.vehicle.no_water_collision);
}

View File

@ -95,28 +95,31 @@ namespace big
}
break;
default:
break;
default: break;
}
}
Vehicle vehicle = self::veh;
if (g.vehicle.rainbow_paint.primary) {
if (g.vehicle.rainbow_paint.primary)
{
VEHICLE::SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(vehicle, red, green, blue);
}
if (g.vehicle.rainbow_paint.secondary) {
if (g.vehicle.rainbow_paint.secondary)
{
VEHICLE::SET_VEHICLE_CUSTOM_SECONDARY_COLOUR(vehicle, red, green, blue);
}
if (g.vehicle.rainbow_paint.neon) {
if (g.vehicle.rainbow_paint.neon)
{
VEHICLE::SET_VEHICLE_NEON_ENABLED(vehicle, 0, 1);
VEHICLE::SET_VEHICLE_NEON_ENABLED(vehicle, 1, 1);
VEHICLE::SET_VEHICLE_NEON_ENABLED(vehicle, 2, 1);
VEHICLE::SET_VEHICLE_NEON_ENABLED(vehicle, 3, 1);
VEHICLE::SET_VEHICLE_NEON_COLOUR(vehicle, red, green, blue);
}
if (g.vehicle.rainbow_paint.smoke) {
if (g.vehicle.rainbow_paint.smoke)
{
VEHICLE::SET_VEHICLE_TYRE_SMOKE_COLOR(vehicle, red, green, blue);
}

View File

@ -1,5 +1,5 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
namespace big
{
@ -20,5 +20,6 @@ namespace big
}
};
seatbelt g_seatbelt("seatbelt", "Seatbelt", "Prevent you from falling off bikes or flying through the windshield", g.vehicle.seatbelt);
seatbelt g_seatbelt("seatbelt", "Seatbelt", "Prevent you from falling off bikes or flying through the windshield",
g.vehicle.seatbelt);
}

Some files were not shown because too many files have changed in this diff Show More