Lua Scripting (#1334)

Closes #83
Fixes #1309
Fixes #1287
Fixes #1129 (actually fixed now)
This commit is contained in:
maybegreat48 2023-06-06 07:40:40 +00:00 committed by GitHub
parent a8750a30fb
commit 70efa40afe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
202 changed files with 156693 additions and 839 deletions

1
.gitignore vendored
View File

@ -6,6 +6,7 @@
# output directory
build/
out/
__pycache__/
# precompiled headers
*.ipch

View File

@ -15,6 +15,7 @@ include(scripts/pugixml.cmake)
include(scripts/json.cmake)
include(scripts/cpr.cmake)
include(scripts/zydis.cmake)
include(scripts/lua.cmake)
message("\nFetching custom modules")
include(scripts/imgui.cmake)
@ -46,7 +47,7 @@ target_include_directories(YimMenu PRIVATE
)
target_precompile_headers(YimMenu PRIVATE "${SRC_DIR}/common.hpp")
target_link_libraries(YimMenu PRIVATE pugixml minhook AsyncLogger dbghelp imgui cpr Zydis)
target_link_libraries(YimMenu PRIVATE pugixml minhook AsyncLogger dbghelp imgui cpr Zydis lua_static)
# Warnings as errors
set_property(TARGET YimMenu PROPERTY COMPILE_WARNING_AS_ERROR ON)

View File

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

12
scripts/lua.cmake Normal file
View File

@ -0,0 +1,12 @@
include(FetchContent)
message("Lua")
FetchContent_Declare(
Lua
GIT_REPOSITORY https://github.com/walterschell/Lua.git
GIT_TAG a2e0125df529894f5e25d7d477b2df4e37690e0f
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable(Lua)
set_property(TARGET lua_static PROPERTY CXX_STANDARD 23)

View File

@ -6,6 +6,7 @@
#include "script_patches.hpp"
#include "services/context_menu/context_menu_service.hpp"
#include "services/orbital_drone/orbital_drone.hpp"
#include "services/tunables/tunables_service.hpp"
#include "services/vehicle/vehicle_control_service.hpp"
#include "services/squad_spawner/squad_spawner.hpp"
#include "thread_pool.hpp"
@ -77,7 +78,6 @@ namespace big
{
looped::vehicle_auto_drive();
looped::vehicle_boost_behavior();
looped::vehicle_god_mode();
looped::derail_train();
looped::drive_train();
@ -85,18 +85,6 @@ namespace big
}
}
void backend::turnsignal_loop()
{
LOG(INFO) << "Starting script: turnsignal";
while (g_running)
{
looped::vehicle_turn_signals();
script::get_current()->yield();
}
}
void backend::misc_loop()
{
LOG(INFO) << "Starting script: Miscellaneous";
@ -104,7 +92,6 @@ namespace big
while (g_running)
{
looped::hud_transition_state();
looped::session_local_time();
looped::session_pop_multiplier_areas();
looped::session_force_thunder();
looped::session_randomize_ceo_colors();
@ -154,18 +141,6 @@ namespace big
}
}
void backend::vehiclefly_loop()
{
LOG(INFO) << "Starting script: Vehicle fly";
while (g_running)
{
looped::vehicle_fly();
script::get_current()->yield();
}
}
void backend::disable_control_action_loop()
{
LOG(INFO) << "Starting script: Disable Control Action";
@ -212,13 +187,17 @@ namespace big
{
while (true)
{
g_vehicle_control_service.tick();
script::get_current()->yield();
}
}
void backend::tunables_script()
{
g_tunables_service->run_script();
}
void backend::squad_spawner()
{
while (true)

View File

@ -10,16 +10,15 @@ namespace big
static void self_loop();
static void weapons_loop();
static void vehicles_loop();
static void turnsignal_loop();
static void misc_loop();
static void remote_loop();
static void lscustoms_loop();
static void rainbowpaint_loop();
static void vehiclefly_loop();
static void disable_control_action_loop();
static void world_loop();
static void orbital_drone();
static void vehicle_control();
static void tunables_script();
static void squad_spawner();
};
}

View File

@ -30,7 +30,9 @@ namespace big
command::command(const std::string& name, const std::string& label, const std::string& description, std::optional<std::uint8_t> num_args, bool fiber_pool) :
m_name(name),
m_label(label),
m_label_hash(rage::joaat(label)),
m_description(description),
m_description_hash(rage::joaat(description)),
m_num_args(num_args),
m_fiber_pool(fiber_pool)
{

View File

@ -11,7 +11,9 @@ namespace big
protected:
std::string m_name;
std::string m_label;
rage::joaat_t m_label_hash;
std::string m_description;
rage::joaat_t m_description_hash;
std::optional<std::uint8_t> m_num_args;
bool m_fiber_pool;
@ -31,13 +33,21 @@ namespace big
{
return m_name;
}
inline const std::string& get_label()
inline const std::string get_label()
{
return m_label;
std::string key;
if (key = g_translation_service.get_translation(m_label_hash); key.empty())
key = m_label;
return key;
}
inline const std::string& get_description()
inline const std::string get_description()
{
return m_description;
std::string key;
if (key = g_translation_service.get_translation(m_description_hash); key.empty())
key = m_description;
return key;
}
inline const std::optional<std::uint8_t>& get_num_args()
{

View File

@ -14,7 +14,7 @@ namespace big
virtual void execute(const std::vector<std::uint64_t>&, const std::shared_ptr<command_context> ctx)
{
ctx->report_error("Money and recovery options are not supported in YimMenu to keep Rockstar/Take Two happy. You can try Kiddion's Modest Menu (free) instead, but make sure to only get it from UnknownCheats.me, the rest are scams and contain malware");
ctx->report_error("Money and recovery options are not supported in YimMenu to keep Rockstar/Take Two happy. You can try Kiddion's Modest Menu (free) instead, but make sure to only get it from UnknownCheats.me, the rest are scams and may contain malware");
}
};

View File

@ -27,5 +27,5 @@ namespace big
}
};
bail_kick g_bail_kick("bailkick", "Bail Kick", "Blocked by most menus", 0);
bail_kick g_bail_kick("bailkick", "BAIL_KICK", "BAIL_KICK_DESC", 0);
}

View File

@ -67,7 +67,7 @@ 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",
breakup_kick g_breakup_kick("breakup", "BREAKUP_KICK", "BREAKUP_KICK_DESC", 0, false);
bool_command g_show_cheating_message("breakupcheating", "BREAKUP_KICK_SHOW_CHEATING", "BREAKUP_KICK_SHOW_CHEATING_DESC",
g.session.show_cheating_message);
}

View File

@ -29,5 +29,5 @@ namespace big
}
};
complaint_kick g_complaint_kick("desync", "Desync Kick", "This may take around 10 seconds to kick the player. Does not work against the host", 0);// this is pretty much desync except we don't actually remove the player from CNetworkPlayerMgr
complaint_kick g_complaint_kick("desync", "COMPLAINT_KICK", "COMPLAINT_KICK_DESC", 0); // this is pretty much desync except we don't actually remove the player from CNetworkPlayerMgr
}

View File

@ -24,9 +24,9 @@ namespace big
}
g_player_service->m_player_to_use_end_session_kick = player;
*scr_globals::gsbd.as<int*>() = (int)(__rdtsc() % 50000) + 6;// making the game trigger the broadcast is a bit difficult and requires a little bit of tampering with the value and luck
*scr_globals::gsbd.as<int*>() = (int)(__rdtsc() % 50000) + 6; // making the game trigger the broadcast is a bit difficult and requires a little bit of tampering with the value and some luck
}
};
end_session_kick g_end_session_kick("endkick", "End Session Kick", "This may take around 10 seconds to kick the player", 0, false);
end_session_kick g_end_session_kick("endkick", "END_KICK", "END_KICK_DESC", 0, false);
}

View File

@ -23,5 +23,5 @@ namespace big
}
};
null_function_kick g_null_function_kick("nfkick", "Null Function Kick", "It may take around 15 seconds for the player to actually leave the session", 0);
null_function_kick g_null_function_kick("nfkick", "NULL_FUNCTION_KICK", "NULL_FUNCTION_KICK_DESC", 0);
}

View File

@ -44,5 +44,5 @@ namespace big
}
};
oom_kick g_oom_kick("oomkick", "OOM Kick", "Causes the player to be kicked with an alert. This kick has a high chance of backfiring in its current state", 0, false);
oom_kick g_oom_kick("oomkick", "OOM_KICK_CMD", "OOM_KICK_CMD_DESC", 0, false);
}

View File

@ -27,5 +27,5 @@ namespace big
}
};
script_host_kick g_script_host_kick("shkick", "Script Host Kick", "Blocked by most menus", 0, false);
script_host_kick g_script_host_kick("shkick", "SCRIPT_HOST_KICK", "SCRIPT_HOST_KICK_DESC", 0, false);
}

View File

@ -20,5 +20,5 @@ namespace big
}
};
clear_wanted_level g_clear_wanted_level("clearwanted", "Clear Wanted Level", "Clears the player's wanted level", 0);
clear_wanted_level g_clear_wanted_level("clearwanted", "CLEAR_WANTED_LEVEL", "CLEAR_WANTED_LEVEL_DESC", 0);
}

View File

@ -48,5 +48,5 @@ namespace big
}
};
enter_interior g_enter_interior("enterint", "Enter Interior", "Enters the player's interior", 0, false);
enter_interior g_enter_interior("enterint", "ENTER_INTERIOR", "ENTER_INTERIOR_DESC", 0, false);
}

View File

@ -21,5 +21,5 @@ namespace big
}
};
give_ammo g_give_ammo("giveammo", "Give Ammo", "Gives the player some ammo", 0);
give_ammo g_give_ammo("giveammo", "GIVE_AMMO", "GIVE_AMMO_DESC", 0);
}

View File

@ -21,5 +21,5 @@ namespace big
}
};
give_armor g_give_armor("givearmor", "Give Armor", "Gives the player some armor", 0);
give_armor g_give_armor("givearmor", "GIVE_ARMOR", "GIVE_ARMOR_DESC", 0);
}

View File

@ -21,5 +21,5 @@ namespace big
}
};
give_health g_give_health("givehealth", "Give Health", "Gives the player some health", 0);
give_health g_give_health("givehealth", "GIVE_HEALTH", "GIVE_HEALTH_DESC", 0);
}

View File

@ -16,5 +16,5 @@ namespace big
}
};
join_ceo g_join_ceo("joinceo", "Join CEO/MC", "Joins the player's CEO/MC", 0, false);
join_ceo g_join_ceo("joinceo", "JOIN_CEO", "JOIN_CEO_DESC", 0, false);
}

View File

@ -15,5 +15,5 @@ namespace big
}
};
steal_identity g_steal_identity("copymodel", "Steal Identity", "Copies the player's model to your ped", 0, false);// do we really need this?
steal_identity g_steal_identity("copymodel", "STEAL_IDENTITY", "STEAL_IDENTITY_DESC", 0, false); // do we really need this?
}

View File

@ -15,5 +15,5 @@ namespace big
}
};
steal_outfit g_steal_outfit("copyoutfit", "Steal Outfit", "Copies the player's outfit to your ped", 0, false);
steal_outfit g_steal_outfit("copyoutfit", "STEAL_OUTFIT", "STEAL_OUTFIT_DESC", 0, false);
}

View File

@ -40,5 +40,5 @@ namespace big
}
};
ceo_kick g_ceo_kick("ceokick", "CEO Kick", "Kicks an associate from the CEO/MC. You cannot kick leaders of CEOs/MCs anymore", 0);
ceo_kick g_ceo_kick("ceokick", "CEO_KICK", "CEO_KICK_DESC", 0);
}

View File

@ -20,5 +20,5 @@ namespace big
}
};
explode_player g_explode_player("explode", "Explode Player", "Blows the player up", 0);
explode_player g_explode_player("explode", "EXPLODE_PLAYER", "EXPLODE_PLAYER_DESC", 0);
}

View File

@ -23,5 +23,5 @@ namespace big
}
};
force_into_mission g_force_into_mission("mission", "Force Into Mission", "Forces the player into a gunrunning mission", 0);
force_into_mission g_force_into_mission("mission", "FORCE_INTO_MISSION", "FORCE_INTO_MISSION_DESC", 0);
}

View File

@ -41,6 +41,6 @@ namespace big
}
};
give_all_weapons g_give_all_weapons("giveweaps", "Give Weapons", "Gives all weapons to the player", 0, false);
give_all_weapons_all g_give_all_weapons_all("giveweapsall", "Give Weapons", "Gives weapons to everyone. Don't spam this or you will crash", 0);
give_all_weapons g_give_all_weapons("giveweaps", "GIVE_WEAPONS", "GIVE_WEAPONS_DESC", 0, false);
give_all_weapons_all g_give_all_weapons_all("giveweapsall", "GIVE_WEAPONS", "GIVE_WEAPONS_ALL_DESC", 0);
}

View File

@ -143,5 +143,5 @@ namespace big
}
};
kick_from_interior g_kick_from_interior("intkick", "Kick From Interior", "Kicks the player from the interior they are in", 0);
kick_from_interior g_kick_from_interior("intkick", "KICK_FROM_INTERIOR", "KICK_FROM_INTERIOR_DESC", 0);
}

View File

@ -29,10 +29,11 @@ namespace big
else
{
// use a private method to kick player from vehicle
(*g_pointers->m_gta.m_network_object_mgr)->ChangeOwner(vehicle->m_net_object, g_player_service->get_self()->get_net_game_player(), 0);
(*g_pointers->m_gta.m_network_object_mgr)
->ChangeOwner(vehicle->m_net_object, g_player_service->get_self()->get_net_game_player(), 0);
}
}
};
kick_from_vehicle g_kick_from_vehicle("vehkick", "Vehicle Kick", "Kicks the player from their current vehicle", 0);
kick_from_vehicle g_kick_from_vehicle("vehkick", "VEHICLE_KICK", "VEHICLE_KICK_DESC", 0);
}

View File

@ -39,5 +39,5 @@ namespace big
}
};
kill_player g_kill_player("kill", "Kill Player", "Kills the player, bypassing most forms of interior godmode", 0);
kill_player g_kill_player("kill", "KILL_PLAYER", "KILL_PLAYER_DESC", 0);
}

View File

@ -21,5 +21,5 @@ namespace big
}
};
ragdoll_player g_ragdoll_player("ragdoll", "Ragdoll Player", "Ragdolls the player", 0);
ragdoll_player g_ragdoll_player("ragdoll", "RAGDOLL_PLAYER", "RAGDOLL_PLAYER_DESC", 0);
}

View File

@ -21,5 +21,5 @@ namespace big
}
};
remove_all_weapons g_remove_all_weapons("remweaps", "Remove All Weapons", "Remove all weapons from the player", 0);
remove_all_weapons g_remove_all_weapons("remweaps", "REMOVE_ALL_WEAPONS", "REMOVE_ALL_WEAPONS_DESC", 0);
}

View File

@ -27,5 +27,5 @@ namespace big
}
};
send_fake_ban_message g_send_fake_ban_message("fakeban", "Send Fake Ban Message", "Sends a fake ban notification to the player", 0);
send_fake_ban_message g_send_fake_ban_message("fakeban", "FAKE_BAN_MESSAGE", "FAKE_BAN_MESSAGE_DESC", 0);
}

View File

@ -32,5 +32,5 @@ namespace big
}
};
send_sext g_send_sext("sext", "Send Sext", "Sends a random sext (with an image attachment) to the player", 0);
send_sext g_send_sext("sext", "SEND_SEXT", "SEND_SEXT_DESC", 0);
}

View File

@ -28,5 +28,5 @@ namespace big
}
};
send_to_apartment g_send_to_apartment("apartmenttp", "TP To Apartment", "Teleports the player to the specified apartment index", 1);
send_to_apartment g_send_to_apartment("apartmenttp", "TP_TO_APARTMENT", "TP_TO_APARTMENT_DESC", 1);
}

View File

@ -28,7 +28,7 @@ namespace big
(int64_t)(int)_args[0],
(int64_t)self::id,
(int64_t) false,
(int64_t) true,// true means enter sender interior
(int64_t) true, // true means enter sender interior
(int64_t) * (uint32_t*)&coords.x,
(int64_t) * (uint32_t*)&coords.y,
(int64_t) * (uint32_t*)&coords.z,
@ -43,5 +43,5 @@ namespace big
}
};
send_to_interior g_send_to_interior("interiortp", "TP To Interior", "Teleports the player to the specified interior index", 1);
send_to_interior g_send_to_interior("interiortp", "TP_TO_INTERIOR", "TP_TO_INTERIOR_DESC", 1);
}

View File

@ -26,5 +26,5 @@ namespace big
}
};
send_to_island g_send_to_island("cayotp", "TP To Cayo Perico", "Teleports the player to Cayo Perico", 0);
send_to_island g_send_to_island("cayotp", "TP_TO_CAYO", "TP_TO_CAYO_DESC", 0);
}

View File

@ -28,5 +28,5 @@ namespace big
}
};
send_to_warehouse g_send_to_warehouse("warehousetp", "TP To Warehouse", "Teleports the player to the specified warehouse index", 1);
send_to_warehouse g_send_to_warehouse("warehousetp", "TP_TO_WAREHOUSE", "TP_TO_WAREHOUSE_DESC", 1);
}

View File

@ -67,5 +67,5 @@ namespace big
}
};
set_wanted_level g_set_wanted_level("wanted", "Set Wanted Level", "Sets the specified wanted level to the player", 1, false);
set_wanted_level g_set_wanted_level("wanted", "SET_WANTED_LEVEL", "SET_WANTED_LEVEL_DESC", 1, false);
}

View File

@ -32,5 +32,5 @@ namespace big
}
};
show_transaction_error g_show_transaction_error("error", "Show Transaction Error", "Shows a transaction error to the player", 0);
show_transaction_error g_show_transaction_error("error", "SHOW_TRANSACTION_ERROR", "SHOW_TRANSACTION_ERROR_DESC", 0);
}

View File

@ -22,5 +22,5 @@ namespace big
}
};
trigger_ceo_raid g_trigger_ceo_raid("ceoraid", "Trigger Special Cargo Raid", "The player has to be in a CEO for this to work", 0);
trigger_ceo_raid g_trigger_ceo_raid("ceoraid", "TRIGGER_CEO_RAID", "TRIGGER_CEO_RAID_DESC", 0);
}

View File

@ -61,14 +61,14 @@ namespace big
return;
*script_local(stack, idx).as<int*>() = 1;
*script_local(stack, idx).at(1).as<int*>() = 2;// stage
*script_local(stack, idx).at(1).at(6).as<int*>() = net_component->get_participant_index(player->get_net_game_player());// beast participant idx
*script_local(stack, idx).at(1).at(7).as<Player*>() = id; // beast player idx
*script_local(stack, idx).at(1).at(2).as<int*>() = INT_MAX;// stopwatch time
*script_local(stack, idx).at(1).at(2).at(1).as<bool*>() = true; // stopwatch initialized
*script_local(stack, idx).at(1).at(4).at(1).as<bool*>() = false; // destroy old stage 1 stopwatch
*script_local(stack, idx).at(1).at(9).as<int*>() = 2; // some distance check
*script_local(stack, idx).at(83).as<int*>() = 0; // transformed bitset
*script_local(stack, idx).at(1).as<int*>() = 2; // stage
*script_local(stack, idx).at(1).at(6).as<int*>() = net_component->get_participant_index(player->get_net_game_player()); // beast participant idx
*script_local(stack, idx).at(1).at(7).as<Player*>() = id; // beast player idx
*script_local(stack, idx).at(1).at(2).as<int*>() = INT_MAX; // stopwatch time
*script_local(stack, idx).at(1).at(2).at(1).as<bool*>() = true; // stopwatch initialized
*script_local(stack, idx).at(1).at(4).at(1).as<bool*>() = false; // destroy old stage 1 stopwatch
*script_local(stack, idx).at(1).at(9).as<int*>() = 2; // some distance check
*script_local(stack, idx).at(83).as<int*>() = 0; // transformed bitset
}
};
@ -125,28 +125,28 @@ namespace big
for (int i = 0; i < 15; i++)
{
*script_local(stack, idx).as<int*>() = 1;
*script_local(stack, idx).at(1).as<int*>() = 2; // stage
*script_local(stack, idx).at(1).at(6).as<int*>() = __rdtsc();// participant idx
*script_local(stack, idx).at(1).at(7).as<Player*>() = __rdtsc();// beast player idx
*script_local(stack, idx).at(1).at(2).as<int*>() = INT_MAX; // stopwatch time
*script_local(stack, idx).at(1).at(2).at(1).as<bool*>() = true; // stopwatch initialized
*script_local(stack, idx).at(1).at(4).at(1).as<bool*>() = false; // destroy old stage 1 stopwatch
*script_local(stack, idx).at(1).at(9).as<int*>() = 2; // some distance check
*script_local(stack, idx).at(83).as<int*>() = 0; // transformed bitset
*script_local(stack, idx).at(1).as<int*>() = 2; // stage
*script_local(stack, idx).at(1).at(6).as<int*>() = __rdtsc(); // participant idx
*script_local(stack, idx).at(1).at(7).as<Player*>() = __rdtsc(); // beast player idx
*script_local(stack, idx).at(1).at(2).as<int*>() = INT_MAX; // stopwatch time
*script_local(stack, idx).at(1).at(2).at(1).as<bool*>() = true; // stopwatch initialized
*script_local(stack, idx).at(1).at(4).at(1).as<bool*>() = false; // destroy old stage 1 stopwatch
*script_local(stack, idx).at(1).at(9).as<int*>() = 2; // some distance check
*script_local(stack, idx).at(83).as<int*>() = 0; // transformed bitset
script::get_current()->yield(350ms);
}
// unfortunately we must also turn ourselves into the beast to prevent the script from exiting due to a "missing player"
*script_local(stack, idx).at(1).at(6).as<int*>() = net_component->m_local_participant_index;// participant idx
*script_local(stack, idx).at(1).at(7).as<Player*>() = self::id;// beast player idx
*script_local(stack, idx).at(1).at(2).as<int*>() = INT_MAX; // stopwatch time
*script_local(stack, idx).at(83).as<int*>() = 0; // transformed bitset
*script_local(stack, idx).at(1).at(6).as<int*>() = net_component->m_local_participant_index; // participant idx
*script_local(stack, idx).at(1).at(7).as<Player*>() = self::id; // beast player idx
*script_local(stack, idx).at(1).at(2).as<int*>() = INT_MAX; // stopwatch time
*script_local(stack, idx).at(83).as<int*>() = 0; // transformed bitset
thread->m_context.m_state = rage::eThreadState::running;
}
};
turn_into_beast g_turn_into_beast("beast", "Turn Into Beast", "Turns the player into the beast", 0, false);
turn_into_beast_all g_turn_into_beast_all("beastall", "Turn Everyone Into Beast", "Turns everyone into the beast, including you", 0);
turn_into_beast g_turn_into_beast("beast", "TURN_INTO_BEAST", "TURN_INTO_BEAST_DESC", 0, false);
turn_into_beast_all g_turn_into_beast_all("beastall", "TURN_INTO_BEAST_ALL", "TURN_INTO_BEAST_ALL_DESC", 0);
}

View File

@ -1,4 +1,5 @@
#include "backend/player_command.hpp"
#include "fiber_pool.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/teleport.hpp"
@ -15,5 +16,19 @@ namespace big
}
};
bring g_bring("bring", "Bring", "Teleports the player to you", 0, false);
class bring_all : command
{
using command::command;
virtual void execute(const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
for (auto& player : g_player_service->players())
g_fiber_pool->queue_job([player]() {
teleport::bring_player(player.second);
});
}
};
bring g_bring("bring", "BRING", "BRING_DESC", 0, false);
bring_all g_bring_all("bringall", "BRING_ALL", "BRING_ALL_DESC", 0, false);
}

View File

@ -1,46 +0,0 @@
#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<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
Ped ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id());
float heading = ENTITY::GET_ENTITY_HEADING(ped);
Vector3 car_coords = ENTITY::GET_ENTITY_COORDS(ped, 1);
if (!PED::IS_PED_IN_ANY_VEHICLE(ped, true))
{
g_notification_service->push_warning("Toxic", "Target player is not in any vehicle.");
}
else
{
Vehicle vehicle = PED::GET_VEHICLE_PED_IS_USING(ped);
float speed = ENTITY::GET_ENTITY_SPEED(vehicle);
if (entity::take_control_of(vehicle))
{
if (heading > 180.0)
heading -= 180.0;
else
heading += 180.0;
ENTITY::SET_ENTITY_COORDS(vehicle, car_coords.x, car_coords.y, car_coords.z, 0, 0, 0, 1);
ENTITY::SET_ENTITY_HEADING(vehicle, heading);
VEHICLE::SET_VEHICLE_FORWARD_SPEED(vehicle, speed);
}
}
}
};
flip_180
g_flip_180("flip180", "Rotate 180", "Rotates their car around", 0)
;
}

View File

@ -16,7 +16,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);
set_bounty g_bounty("bounty", "BOUNTY", "BOUNTY_DESC", 0);
bool_command g_anonymous_bounty("anonbounty", "BOUNTY_ANON", "BOUNTY_ANON_DESC", g.session.anonymous_bounty);
}

View File

@ -16,5 +16,5 @@ namespace big
}
};
teleport_to_player g_teleport_to_player("playertp", "Teleport", "Teleports you to the player", 0, false);
teleport_to_player g_teleport_to_player("playertp", "TELEPORT", "TELEPORT_DESC", 0, false);
}

View File

@ -18,5 +18,5 @@ namespace big
}
};
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);
teleport_into_vehicle g_teleport_into_vehicle("playervehtp", "TELEPORT_INTO_VEHICLE", "TELEPORT_INTO_VEHICLE_DESC", 0, false);
}

View File

@ -14,7 +14,7 @@ namespace big
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.");
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_PLAYER_IS_NOT_IN_VEHICLE"_T.data());
}
else
{
@ -26,7 +26,7 @@ namespace big
}
else
{
g_notification_service->push_warning("Toxic", "Failed to take control of player vehicle.");
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_FAILED_TO_TAKE_CONTROL"_T.data());
}
}
}

View File

@ -12,23 +12,21 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> 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.");
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_PLAYER_IS_NOT_IN_VEHICLE"_T.data());
}
else
{
Vehicle vehicle = PED::GET_VEHICLE_PED_IS_USING(ped);
Vehicle vehicle = PED::GET_VEHICLE_PED_IS_IN(ped, false);
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++)
for (int tire = 0; tire < 8; tire++)
{
VEHICLE::SET_VEHICLE_TYRE_BURST(vehicle, tireID, true, 1000.0);
VEHICLE::SET_VEHICLE_TYRE_BURST(vehicle, tire, true, 1000.0f);
}
}
}

View File

@ -11,9 +11,10 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> 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.");
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_PLAYER_IS_NOT_IN_VEHICLE"_T.data());
}
else
{

View File

@ -13,10 +13,10 @@ namespace big
{
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(ped, true))
{
g_notification_service->push_warning("Toxic", "Target player is not in a vehicle.");
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_PLAYER_IS_NOT_IN_VEHICLE"_T.data());
}
else
{

View File

@ -0,0 +1,46 @@
#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<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
Ped player_ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id());
Vehicle vehicle = PED::GET_VEHICLE_PED_IS_IN(player_ped, false);
float heading = ENTITY::GET_ENTITY_HEADING(vehicle);
Vector3 flipCar180Coords = ENTITY::GET_ENTITY_COORDS(vehicle, 1);
if (!PED::IS_PED_IN_ANY_VEHICLE(player_ped, true))
{
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_PLAYER_IS_NOT_IN_VEHICLE"_T.data());
}
else
{
if (entity::take_control_of(vehicle))
{
if (heading > 180.0)
{
heading -= 180.0;
}
else
{
heading += 180.0;
ENTITY::SET_ENTITY_COORDS(vehicle, flipCar180Coords.x, flipCar180Coords.y, flipCar180Coords.z, 0, 0, 0, 1);
ENTITY::SET_ENTITY_HEADING(vehicle, heading);
VEHICLE::SET_VEHICLE_FORWARD_SPEED(vehicle, ENTITY::GET_ENTITY_SPEED(vehicle));
}
}
}
}
};
flip_180
g_flip_180("flip180", "Rotate 180", "Rotates their car around", 0)
;
}

View File

@ -12,9 +12,10 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> 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.");
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_PLAYER_IS_NOT_IN_VEHICLE"_T.data());
}
else
{

View File

@ -13,7 +13,7 @@ namespace big
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.");
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_PLAYER_IS_NOT_IN_VEHICLE"_T.data());
}
else
{

View File

@ -12,17 +12,20 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> 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))
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.");
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_PLAYER_IS_NOT_IN_VEHICLE"_T.data());
}
else
{
if (entity::take_control_of(ent))
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(ped, false);
if (entity::take_control_of(veh))
{
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);
entity::take_control_of(veh);
VEHICLE::SET_VEHICLE_DOORS_LOCKED(veh, 4);
}
}
}

View File

@ -14,7 +14,7 @@ namespace big
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.");
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_PLAYER_IS_NOT_IN_VEHICLE"_T.data());
}
else
{
@ -22,7 +22,7 @@ namespace big
if (entity::take_control_of(vehicle))
{
for (int i = 0; i < 7; i++)
for (int i = 0; i < VEHICLE::GET_NUMBER_OF_VEHICLE_DOORS(i); i++)
{
VEHICLE::SET_VEHICLE_DOOR_OPEN(vehicle, i, true, false);
}

View File

@ -14,12 +14,16 @@ namespace big
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 vehicle = PED::GET_VEHICLE_PED_IS_IN(ped, false);
if (entity::take_control_of(vehicle))
{
VEHICLE::SMASH_VEHICLE_WINDOW(UserVeh, windowID);
int window = 0;
for (window = 0; window < 8; window++)
{
VEHICLE::SMASH_VEHICLE_WINDOW(vehicle, window);
}
}
}
}

View File

@ -13,14 +13,15 @@ namespace big
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.");
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_PLAYER_IS_NOT_IN_VEHICLE"_T.data());
}
else
{
Vehicle vehicle = PED::GET_VEHICLE_PED_IS_USING(ped);
if (entity::take_control_of(vehicle))
{
VEHICLE::SET_VEHICLE_FORWARD_SPEED(vehicle, 0);
VEHICLE::BRING_VEHICLE_TO_HALT(vehicle, 0.0f, 1, 0);
}
else
{

View File

@ -10,10 +10,10 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
if (PED::IS_PED_IN_ANY_VEHICLE((player->id()), false))
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);
if (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);
}
}
};

View File

@ -12,8 +12,17 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
Vehicle vehicle = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()), false);
vehicle::max_vehicle(vehicle);
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(ped, true))
{
g_notification_service->push_warning("TOXIC"_T.data(), "ERROR_PLAYER_IS_NOT_IN_VEHICLE"_T.data());
}
else
{
vehicle::max_vehicle(vehicle);
}
}
};

View File

@ -13,12 +13,13 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> 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 vehicle = PED::GET_VEHICLE_PED_IS_IN(ped, false);
VEHICLE::SET_VEHICLE_WINDOW_TINT(UserVeh, WINDOWTINT_BLACK);
if (entity::take_control_of(vehicle))
VEHICLE::SET_VEHICLE_WINDOW_TINT(vehicle, WINDOWTINT_BLACK);
}
}
};

View File

@ -14,5 +14,5 @@ namespace big
}
};
heal g_heal("heal", "Heal", "Restores full health and armor", 0);
heal g_heal("heal", "HEAL", "HEAL_DESC", 0);
}

View File

@ -3,7 +3,7 @@
namespace big
{
class int_command : command
class int_command : public command
{
protected:
int& m_value;
@ -19,5 +19,13 @@ namespace big
{
return m_value;
}
inline int get_lower_bound()
{
return m_lower_bound;
}
inline int get_upper_bound()
{
return m_upper_bound;
}
};
}

View File

@ -28,7 +28,6 @@ namespace big
static void self_hud();
static void self_dance_mode();
static void session_local_time();
static void session_pop_multiplier_areas();
static void session_force_thunder();
static void session_block_jobs();
@ -43,11 +42,8 @@ namespace big
static void vehicle_auto_drive();
static void vehicle_boost_behavior();
static void vehicle_fly();
static void vehicle_god_mode();
static void vehicle_ls_customs();
static void vehicle_rainbow_paint();
static void vehicle_turn_signals();
static void weapons_ammo_special_type();
static void weapons_cage_gun();

View File

@ -14,6 +14,5 @@ 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", "KEEP_PLAYER_CLEAN_DESC", g.self.clean_player);
}

View File

@ -18,9 +18,10 @@ namespace big
ENTITY::SET_ENTITY_COORDS_NO_OFFSET(self::ped, self::pos.x, self::pos.y, self::pos.z, 0, 0, 0);
TASK::CLEAR_PED_TASKS_IMMEDIATELY(self::ped);
MISC::FORCE_GAME_STATE_PLAYING();
MISC::TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME("respawn_controller");
}
}
};
fast_respawn g_fast_respawn("fastrespawn", "Instant Respawn", "Makes you respawn instantly when you die", g.self.fast_respawn);
fast_respawn g_fast_respawn("fastrespawn", "INSTANT_RESPAWN", "INSTANT_RESPAWN_DESC", g.self.fast_respawn);
}

View File

@ -71,7 +71,7 @@ namespace big
Vector3 rot = CAM::GET_CAM_ROT(camera, 2);
//float pitch = math::deg_to_rad(rot.x); // vertical
//float roll = rot.y;
float yaw = math::deg_to_rad(rot.z);// horizontal
float yaw = math::deg_to_rad(rot.z); // horizontal
position.x += (vecChange.x * cos(yaw) - vecChange.y * sin(yaw)) * mult;
position.y += (vecChange.x * sin(yaw) + vecChange.y * cos(yaw)) * mult;
@ -95,5 +95,5 @@ namespace big
}
};
free_cam g_free_cam("freecam", "Freecam", "Allows you to move your camera freely?", g.self.free_cam);
free_cam g_free_cam("freecam", "FREECAM", "FREECAM_DESC", g.self.free_cam);
}

View File

@ -37,5 +37,5 @@ namespace big
static bool true_ref = true;
godmode_internal g_godmode_internal("$$godmode", "", "", true_ref);
bool_command g_godmode("godmode", "God Mode", "Prevents you from taking any form of damage", g.self.god_mode);
bool_command g_godmode("godmode", "GODMODE", "GODMODE_DESC", g.self.god_mode);
}

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,5 @@ namespace big
}
};
health_regen_looped g_health_regen_looped("healthregen", "Override Health Regen", "Turn on the regen multiplier you have set.", g.self.healthregen);
health_regen_looped g_health_regen_looped("healthregen", "HEALTH_REGEN", "HEALTH_REGEN_DESC", g.self.healthregen);
}

View File

@ -36,7 +36,6 @@ namespace big
}
};
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);
invisibility g_invisibility("invis", "INVISIBILITY", "INVISIBILITY_DESC", g.self.invisibility);
bool_command g_local_visibility("localvis", "LOCAL_VISIBILITY", "LOCAL_VISIBILITY_DESC", g.self.local_visibility);
}

View File

@ -20,5 +20,5 @@ namespace big
}
};
mobile_radio g_mobile_radio("mobileradio", "Mobile Radio", "Allows you to listen to the radio on foot", g.self.mobile_radio);
mobile_radio g_mobile_radio("mobileradio", "MOBILE_RADIO", "MOBILE_RADIO_DESC", g.self.mobile_radio);
}

View File

@ -28,6 +28,5 @@ namespace big
->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", "NO_COLLISION_DESC", g.self.no_collision);
}

View File

@ -20,5 +20,5 @@ namespace big
}
};
no_ragdoll g_no_ragdoll("noragdoll", "No Ragdoll", "Prevents you from ragdolling", g.self.no_ragdoll);
no_ragdoll g_no_ragdoll("noragdoll", "NO_RAGDOLL", "NO_RAGDOLL_DESC", g.self.no_ragdoll);
}

View File

@ -22,6 +22,5 @@ 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", "WALK_UNDERWATER_DESC", g.self.no_water_collision);
}

View File

@ -3,8 +3,8 @@
#include "fiber_pool.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
#include "util/entity.hpp"
#include "services/orbital_drone/orbital_drone.hpp"
#include "util/entity.hpp"
namespace big
{
@ -94,5 +94,5 @@ namespace big
}
};
noclip g_noclip("noclip", "No Clip", "Allows you to fly through the map", g.self.noclip);
noclip g_noclip("noclip", "NO_CLIP", "NO_CLIP_DESC", g.self.noclip);
}

View File

@ -20,5 +20,5 @@ namespace big
}
};
off_radar g_off_radar("otr", "Off Radar", "Hides your blip from other players", g.self.off_radar);
off_radar g_off_radar("otr", "OFF_RADAR", "OFF_RADAR_DESC", g.self.off_radar);
}

View File

@ -4,6 +4,7 @@
namespace big
{
// this doesn't actually work
class partwater : looped_command
{
using looped_command::looped_command;
@ -30,5 +31,5 @@ namespace big
}
};
partwater g_partwater("partwater", "Part Water", "Makes you like Moses", g.world.water.part_water);
partwater g_partwater("partwater", "PART_WATER", "PART_WATER_DESC", g.world.water.part_water);
}

View File

@ -33,12 +33,12 @@ namespace big
1,
1,
1);
STREAMING::REMOVE_PTFX_ASSET();
}
}
void show_vehicle_ptfx_effect(const char* fx_name, const char* name)
{
STREAMING::REQUEST_NAMED_PTFX_ASSET(fx_name);
for (const auto& ptfx_bone : ptfx_vehicle_pos)
{
GRAPHICS::USE_PARTICLE_FX_ASSET(fx_name);
@ -65,7 +65,12 @@ namespace big
else
show_vehicle_ptfx_effect(g.self.ptfx_effects.asset, g.self.ptfx_effects.effect);
}
virtual void on_disable() override
{
STREAMING::REMOVE_PTFX_ASSET();
}
};
ptfx_looped g_ptfx_looped("ptfx", "Enable PTFX", "Show nice PTFX Effects on your character", g.self.ptfx_effects.show);
ptfx_looped g_ptfx_looped("ptfx", "PTFX_CMD", "PTFX_CMD_DESC", g.self.ptfx_effects.show);
}

View File

@ -61,5 +61,5 @@ namespace big
}
};
super_run g_super_run("fastrun", "Super Run", "Makes you run much faster", g.self.super_run);
super_run g_super_run("fastrun", "SUPER_RUN", "SUPER_RUN_DESC", g.self.super_run);
}

View File

@ -37,5 +37,5 @@ namespace big
}
};
superman g_superman("superman", "Superman", "Fly like a superman", g.self.superman);
superman g_superman("superman", "SUPERMAN", "SUPERMAN_DESC", g.self.superman);
}

View File

@ -16,6 +16,5 @@ 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", "UNLIMITED_OXYGEN_DESC", g.self.unlimited_oxygen);
}

View File

@ -1,30 +0,0 @@
#include "backend/looped/looped.hpp"
#include "natives.hpp"
namespace big
{
static bool toggled = true;
void looped::session_local_time()
{
if (g.session.override_time)
{
if (toggled)
{
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);
}
else
{
NETWORK::NETWORK_CLEAR_CLOCK_TIME_OVERRIDE();
toggled = true;
}
}
}

View File

@ -10,14 +10,10 @@ namespace big
virtual void on_tick() override
{
//this is a hack to prevent the warning notify..
if (!teleport::to_blip((int)BlipIcons::Waypoint))
return;
teleport::to_waypoint();
teleport::to_blip((int)BlipIcons::Waypoint);
}
};
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.",
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

@ -9,7 +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::unordered_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;

View File

@ -12,45 +12,32 @@ namespace big
const rage::joaat_t drive_on_water_surface_hash = RAGE_JOAAT("stt_prop_stunt_bblock_xl3");
Vector3 drive_on_water_last_loc;
Object surface;
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);
if (surface)
if (surface && entity::take_control_of(surface, 0))
{
entity::take_control_of(surface);
ENTITY::SET_ENTITY_COORDS(surface, 0, 0, -1000.0f, 0, 0, 0, 1);
ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&surface);
ENTITY::DELETE_ENTITY(&surface);
WATER::RESET_DEEP_OCEAN_SCALER();
surface = 0;
}
WATER::RESET_DEEP_OCEAN_SCALER();
}
virtual void on_tick() override
{
Vector3 location = ENTITY::GET_ENTITY_COORDS(self::veh, 1);
Vector3 location = ENTITY::GET_ENTITY_COORDS(self::veh, true);
float height = 0;
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);
if (self::veh)
WATER::SET_DEEP_OCEAN_SCALER(0);
if (self::veh && location.z - height < 10
&& WATER::GET_WATER_HEIGHT_NO_WAVES(location.x, location.y, location.z, &height))
{
if (ENTITY::DOES_ENTITY_EXIST(surface) && height > -50.0f)
{
entity::take_control_of(surface);
@ -68,8 +55,8 @@ namespace big
if (location.z < height - 2.f)
{
entity::take_control_of(self::veh);
ENTITY::SET_ENTITY_COORDS(self::veh, location.x, location.y, height, 0, 0, 0, 0);
if (entity::take_control_of(self::veh, 0))
ENTITY::SET_ENTITY_COORDS(self::veh, location.x, location.y, height, 0, 0, 0, 0);
}
}
else
@ -90,7 +77,6 @@ namespace big
1,
0);
entity::take_control_of(surface);
ENTITY::FREEZE_ENTITY_POSITION(surface, 1);
ENTITY::SET_ENTITY_ALPHA(surface, 0, 1);
ENTITY::SET_ENTITY_VISIBLE(surface, false, 0);

View File

@ -1,100 +1,17 @@
#include "backend/looped/looped.hpp"
#include "backend/looped_command.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
#include "util/entity.hpp"
namespace big
{
static bool last_fly_tick = false;
void do_vehicle_fly()
class vehicle_fly : looped_command
{
Vehicle vehicle = self::veh;
using looped_command::looped_command;
Vector3 cam_pos = CAM::GET_GAMEPLAY_CAM_ROT(0);
ENTITY::SET_ENTITY_ROTATION(vehicle, cam_pos.x, cam_pos.y, cam_pos.z, 1, true);
ENTITY::SET_ENTITY_COLLISION(vehicle, !g.vehicle.fly.no_collision, true);
Vehicle last_vehicle = 0;
float locspeed = g.vehicle.fly.speed;
if (PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_MOVE_UP_ONLY))
void cleanup(Vehicle vehicle)
{
locspeed *= 2;
}
if (PAD::IS_CONTROL_PRESSED(2, (int)ControllerInputs::INPUT_VEH_ACCELERATE))
{
if (g.vehicle.fly.dont_stop)
{
ENTITY::APPLY_FORCE_TO_ENTITY(vehicle, 1, 0.0, g.vehicle.fly.speed, 0.0, 0.0, 0.0, 0.0, 0, 1, 1, 1, 0, 1);
}
else
{
VEHICLE::SET_VEHICLE_FORWARD_SPEED(vehicle, locspeed);
}
}
if (PAD::IS_CONTROL_PRESSED(2, (int)ControllerInputs::INPUT_VEH_BRAKE))
{
float lsp = g.vehicle.fly.speed;
if (!PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_MOVE_UP_ONLY))
{
lsp = (g.vehicle.fly.speed * 2);
}
if (g.vehicle.fly.dont_stop)
{
ENTITY::APPLY_FORCE_TO_ENTITY(vehicle, 1, 0.0, 0 - (lsp), 0.0, 0.0, 0.0, 0.0, 0, 1, 1, 1, 0, 1);
}
else
{
VEHICLE::SET_VEHICLE_FORWARD_SPEED(vehicle, (0 - locspeed));
}
}
if (PAD::IS_CONTROL_PRESSED(2, (int)ControllerInputs::INPUT_VEH_MOVE_LEFT_ONLY))
{
float lsp = ((0 - g.vehicle.fly.speed) * 2);
if (!PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_MOVE_UP_ONLY))
{
lsp = (0 - g.vehicle.fly.speed);
}
if (g.vehicle.fly.dont_stop)
{
ENTITY::APPLY_FORCE_TO_ENTITY(vehicle, 1, (lsp), 0.0, 0.0, 0.0, 0.0, 0.0, 0, 1, 1, 1, 0, 1);
}
else
{
ENTITY::APPLY_FORCE_TO_ENTITY(vehicle, 1, (0 - (locspeed)), 0.0, 0.0, 0.0, 0.0, 0.0, 0, 1, 1, 1, 0, 1);
}
}
if (PAD::IS_CONTROL_PRESSED(2, (int)ControllerInputs::INPUT_VEH_MOVE_RIGHT_ONLY))
{
float lsp = g.vehicle.fly.speed;
if (!PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_MOVE_UP_ONLY))
{
lsp = (g.vehicle.fly.speed * 2);
}
if (g.vehicle.fly.dont_stop)
{
ENTITY::APPLY_FORCE_TO_ENTITY(vehicle, 1, lsp, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 1, 1, 1, 0, 1);
}
else
{
ENTITY::APPLY_FORCE_TO_ENTITY(vehicle, 1, locspeed, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 1, 1, 1, 0, 1);
}
}
if (!g.vehicle.fly.dont_stop && !PAD::IS_CONTROL_PRESSED(2, (int)ControllerInputs::INPUT_VEH_ACCELERATE) && !PAD::IS_CONTROL_PRESSED(2, (int)ControllerInputs::INPUT_VEH_BRAKE))
{
VEHICLE::SET_VEHICLE_FORWARD_SPEED(vehicle, 0.0);
}
if (TASK::GET_IS_TASK_ACTIVE(self::ped, 2))
{
g.vehicle.fly.enabled = false;
VEHICLE::SET_VEHICLE_GRAVITY(vehicle, true);
ENTITY::SET_ENTITY_COLLISION(vehicle, true, true);
if (g.vehicle.fly.stop_on_exit)
@ -102,46 +19,110 @@ namespace big
VEHICLE::SET_VEHICLE_FORWARD_SPEED(vehicle, 0.0);
}
}
}
void looped::vehicle_fly()
{
Vehicle vehicle = self::veh;
if (g.vehicle.fly.enabled)
virtual void on_tick() override
{
last_fly_tick = true;
Vehicle vehicle = self::veh;
if (!vehicle)
if (last_vehicle != vehicle)
{
g_notification_service->push_warning("Warning", "Please be in a vehicle before enabling vehicle fly.");
g.vehicle.fly.enabled = false;
return;
if (last_vehicle)
cleanup(last_vehicle);
last_vehicle = vehicle;
}
else
if (vehicle)
{
if (NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(vehicle))
Vector3 cam_pos = CAM::GET_GAMEPLAY_CAM_ROT(0);
ENTITY::SET_ENTITY_ROTATION(vehicle, cam_pos.x, cam_pos.y, cam_pos.z, 1, true);
ENTITY::SET_ENTITY_COLLISION(vehicle, !g.vehicle.fly.no_collision, true);
float locspeed = g.vehicle.fly.speed;
if (PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_MOVE_UP_ONLY))
{
do_vehicle_fly();
VEHICLE::SET_VEHICLE_GRAVITY(vehicle, false);
locspeed *= 2;
}
else
if (PAD::IS_CONTROL_PRESSED(2, (int)ControllerInputs::INPUT_VEH_ACCELERATE))
{
for (int i = 0; i < 5; i++)
if (g.vehicle.fly.dont_stop)
{
entity::take_control_of(vehicle);
g_notification_service->push_warning("Warning", "Failed to take control of the vehicle.");
ENTITY::APPLY_FORCE_TO_ENTITY(vehicle, 1, 0.0, g.vehicle.fly.speed, 0.0, 0.0, 0.0, 0.0, 0, 1, 1, 1, 0, 1);
}
else
{
VEHICLE::SET_VEHICLE_FORWARD_SPEED(vehicle, locspeed);
}
}
if (PAD::IS_CONTROL_PRESSED(2, (int)ControllerInputs::INPUT_VEH_BRAKE))
{
float lsp = g.vehicle.fly.speed;
if (!PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_MOVE_UP_ONLY))
{
lsp = (g.vehicle.fly.speed * 2);
}
if (g.vehicle.fly.dont_stop)
{
ENTITY::APPLY_FORCE_TO_ENTITY(vehicle, 1, 0.0, 0 - (lsp), 0.0, 0.0, 0.0, 0.0, 0, 1, 1, 1, 0, 1);
}
else
{
VEHICLE::SET_VEHICLE_FORWARD_SPEED(vehicle, (0 - locspeed));
}
}
if (PAD::IS_CONTROL_PRESSED(2, (int)ControllerInputs::INPUT_VEH_MOVE_LEFT_ONLY))
{
float lsp = ((0 - g.vehicle.fly.speed) * 2);
if (!PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_MOVE_UP_ONLY))
{
lsp = (0 - g.vehicle.fly.speed);
}
if (g.vehicle.fly.dont_stop)
{
ENTITY::APPLY_FORCE_TO_ENTITY(vehicle, 1, (lsp), 0.0, 0.0, 0.0, 0.0, 0.0, 0, 1, 1, 1, 0, 1);
}
else
{
ENTITY::APPLY_FORCE_TO_ENTITY(vehicle, 1, (0 - (locspeed)), 0.0, 0.0, 0.0, 0.0, 0.0, 0, 1, 1, 1, 0, 1);
}
}
if (PAD::IS_CONTROL_PRESSED(2, (int)ControllerInputs::INPUT_VEH_MOVE_RIGHT_ONLY))
{
float lsp = g.vehicle.fly.speed;
if (!PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_MOVE_UP_ONLY))
{
lsp = (g.vehicle.fly.speed * 2);
}
if (g.vehicle.fly.dont_stop)
{
ENTITY::APPLY_FORCE_TO_ENTITY(vehicle, 1, lsp, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 1, 1, 1, 0, 1);
}
else
{
ENTITY::APPLY_FORCE_TO_ENTITY(vehicle, 1, locspeed, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 1, 1, 1, 0, 1);
}
}
if (!g.vehicle.fly.dont_stop && !PAD::IS_CONTROL_PRESSED(2, (int)ControllerInputs::INPUT_VEH_ACCELERATE) && !PAD::IS_CONTROL_PRESSED(2, (int)ControllerInputs::INPUT_VEH_BRAKE))
{
VEHICLE::SET_VEHICLE_FORWARD_SPEED(vehicle, 0.0);
}
VEHICLE::SET_VEHICLE_GRAVITY(vehicle, false);
}
}
else
virtual void on_disable() override
{
if (last_fly_tick)
{
ENTITY::SET_ENTITY_COLLISION(vehicle, true, true);
VEHICLE::SET_VEHICLE_GRAVITY(vehicle, true);
last_fly_tick = false;
}
if (self::veh)
cleanup(self::veh);
}
}
};
vehicle_fly g_vehicle_fly("vehiclefly", "Vehicle Fly", "Fly with any land vehicle", g.vehicle.fly.enabled);
}

View File

@ -1,3 +1,5 @@
#include "backend/bool_command.hpp"
#include "backend/int_command.hpp"
#include "backend/looped/looped.hpp"
#include "natives.hpp"
#include "script.hpp"
@ -127,4 +129,16 @@ namespace big
last_rgb_run_time = std::chrono::system_clock::now();
}
}
bool_command g_rainbow_paint_primary("rainbowpri", "Rainbow Paint: Apply to Primary", "Applies active rainbow effect to the current vehicle's primary color",
g.vehicle.rainbow_paint.primary);
bool_command g_rainbow_paint_secondary("rainbowsec", "Rainbow Paint: Apply to Secondary", "Applies active rainbow effect to the current vehicle's secondary color",
g.vehicle.rainbow_paint.secondary);
bool_command g_rainbow_paint_neon("rainbowneons", "Rainbow Paint: Apply to Neons", "Applies active rainbow effect to the current vehicle's neon color",
g.vehicle.rainbow_paint.neon);
bool_command g_rainbow_paint_smoke("rainbowsmoke", "Rainbow Paint: Apply to Tire Smoke", "Applies active rainbow effect to the current vehicle's tire smoke color",
g.vehicle.rainbow_paint.smoke);
int_command g_rainbow_paint_speed("rainbowspeed", "Rainbow Paint: Speed", "Speed of the rainbow paint effect",
g.vehicle.rainbow_paint.speed, 1, 10);
}

View File

@ -1,4 +1,4 @@
#include "backend/looped/looped.hpp"
#include "backend/looped_command.hpp"
#include "fiber_pool.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
@ -6,161 +6,160 @@
#include "util/is_key_pressed.hpp"
#include "windows.h"
struct key_state
{
key_state(int v_key) :
v_key(v_key)
{
}
enum
{
up,
down,
just_pressed,
just_released,
};
uint8_t state = up;
int v_key;
};
inline key_state right_signal_key{'L'};
inline key_state left_signal_key{'J'};
inline key_state hazzards_key{'K'};
void update_key_state(key_state& key_last_tick)
{
if (big::is_key_pressed(key_last_tick.v_key))
{
switch (key_last_tick.state)
{
case key_state::up: key_last_tick.state = key_state::just_pressed; break;
case key_state::just_pressed: key_last_tick.state = key_state::down; break;
}
}
else
{
switch (key_last_tick.state)
{
case key_state::down: key_last_tick.state = key_state::just_released; break;
case key_state::just_released: key_last_tick.state = key_state::up; break;
}
}
}
void update_key_states()
{
update_key_state(left_signal_key);
update_key_state(hazzards_key);
update_key_state(right_signal_key);
}
struct signal_state
{
enum
{
right,
left,
hazzards
};
};
inline void set_turn_signals(int signal_state, bool on)
{
static constexpr int off = 0;
if (self::veh && big::g.vehicle.turn_signals)
{
switch (signal_state)
{
case signal_state::hazzards:
VEHICLE::SET_VEHICLE_INDICATOR_LIGHTS(self::veh, signal_state::left, on);
VEHICLE::SET_VEHICLE_INDICATOR_LIGHTS(self::veh, signal_state::right, on);
break;
case signal_state::right:
VEHICLE::SET_VEHICLE_INDICATOR_LIGHTS(self::veh, signal_state::left, off);
VEHICLE::SET_VEHICLE_INDICATOR_LIGHTS(self::veh, signal_state::right, on);
break;
case signal_state::left:
VEHICLE::SET_VEHICLE_INDICATOR_LIGHTS(self::veh, signal_state::left, on);
VEHICLE::SET_VEHICLE_INDICATOR_LIGHTS(self::veh, signal_state::right, off);
break;
}
}
}
namespace big
{
static bool b_last_turn_signals = false;
void looped::vehicle_turn_signals()
struct key_state
{
static bool hazzards = false;
bool b_turn_signals = g.vehicle.turn_signals;
if (!b_turn_signals && b_turn_signals != b_last_turn_signals)
key_state(int v_key) :
v_key(v_key)
{
VEHICLE::SET_VEHICLE_INDICATOR_LIGHTS(PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false), 0, 0);
VEHICLE::SET_VEHICLE_INDICATOR_LIGHTS(PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false), 1, 0);
}
if (g.vehicle.turn_signals)
enum
{
static bool ran_once = [] {
g_notification_service->push("Instructions", "Manual: J = Left, L = Right, K = Toggle Hazzards");
return true;
}();
}
up,
down,
just_pressed,
just_released,
};
uint8_t state = up;
int v_key;
};
update_key_states();
class turn_signals : looped_command
{
using looped_command::looped_command;
if (left_signal_key.state == key_state::just_pressed || g.vehicle.auto_turn_signals && PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_MOVE_LEFT_ONLY))
key_state right_signal_key{'L'};
key_state left_signal_key{'J'};
key_state hazzards_key{'K'};
std::optional<std::chrono::system_clock::time_point> queued_left_turn_signal;
std::optional<std::chrono::system_clock::time_point> queued_right_turn_signal;
bool hazzards = false;
void update_key_state(key_state& key_last_tick)
{
set_turn_signals(signal_state::left, true);
}
if (right_signal_key.state == key_state::just_pressed || g.vehicle.auto_turn_signals && PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_MOVE_RIGHT_ONLY))
{
set_turn_signals(signal_state::right, true);
}
if (hazzards_key.state == key_state::just_pressed && !hazzards)
{
set_turn_signals(signal_state::hazzards, true);
hazzards = true;
}
else if (hazzards_key.state == key_state::just_pressed && hazzards || !g.vehicle.turn_signals)
{
set_turn_signals(signal_state::hazzards, false);
hazzards = false;
}
if (PAD::IS_CONTROL_JUST_RELEASED(0, (int)ControllerInputs::INPUT_VEH_MOVE_LEFT_ONLY))
{
if (g.vehicle.turn_signals)
if (big::is_key_pressed(key_last_tick.v_key))
{
script::get_current()->yield(1500ms);
}
set_turn_signals(signal_state::left, false);
}
switch (key_last_tick.state)
{
case key_state::up: key_last_tick.state = key_state::just_pressed; break;
if (PAD::IS_CONTROL_JUST_RELEASED(0, (int)ControllerInputs::INPUT_VEH_MOVE_RIGHT_ONLY))
{
if (g.vehicle.turn_signals)
case key_state::just_pressed: key_last_tick.state = key_state::down; break;
}
}
else
{
script::get_current()->yield(1500ms);
switch (key_last_tick.state)
{
case key_state::down: key_last_tick.state = key_state::just_released; break;
case key_state::just_released: key_last_tick.state = key_state::up; break;
}
}
set_turn_signals(signal_state::right, false);
}
b_last_turn_signals = g.vehicle.turn_signals;
}
}
void update_key_states()
{
update_key_state(left_signal_key);
update_key_state(hazzards_key);
update_key_state(right_signal_key);
}
struct signal_state
{
enum
{
right,
left,
hazzards
};
};
inline void set_turn_signals(int signal_state, bool on)
{
static constexpr int off = 0;
if (self::veh && big::g.vehicle.turn_signals)
{
switch (signal_state)
{
case signal_state::hazzards:
VEHICLE::SET_VEHICLE_INDICATOR_LIGHTS(self::veh, signal_state::left, on);
VEHICLE::SET_VEHICLE_INDICATOR_LIGHTS(self::veh, signal_state::right, on);
break;
case signal_state::right:
VEHICLE::SET_VEHICLE_INDICATOR_LIGHTS(self::veh, signal_state::left, off);
VEHICLE::SET_VEHICLE_INDICATOR_LIGHTS(self::veh, signal_state::right, on);
break;
case signal_state::left:
VEHICLE::SET_VEHICLE_INDICATOR_LIGHTS(self::veh, signal_state::left, on);
VEHICLE::SET_VEHICLE_INDICATOR_LIGHTS(self::veh, signal_state::right, off);
break;
}
}
}
virtual void on_enable() override
{
g_notification_service->push("Instructions", "Manual: J = Left, L = Right, K = Toggle Hazzards");
}
virtual void on_tick() override
{
update_key_states();
if (left_signal_key.state == key_state::just_pressed || g.vehicle.auto_turn_signals && PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_MOVE_LEFT_ONLY)
|| queued_left_turn_signal.has_value() && queued_left_turn_signal.value() - std::chrono::system_clock::now() > 1500ms)
{
set_turn_signals(signal_state::left, true);
queued_left_turn_signal = std::nullopt;
}
if (right_signal_key.state == key_state::just_pressed || g.vehicle.auto_turn_signals && PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_MOVE_RIGHT_ONLY)
|| queued_right_turn_signal.has_value() && queued_right_turn_signal.value() - std::chrono::system_clock::now() > 1500ms)
{
set_turn_signals(signal_state::right, true);
queued_right_turn_signal = std::nullopt;
}
if (hazzards_key.state == key_state::just_pressed && !hazzards)
{
set_turn_signals(signal_state::hazzards, true);
hazzards = true;
}
else if (hazzards_key.state == key_state::just_pressed && hazzards || !g.vehicle.turn_signals)
{
set_turn_signals(signal_state::hazzards, false);
hazzards = false;
}
if (!queued_left_turn_signal.has_value() && !queued_right_turn_signal.has_value())
{
if (PAD::IS_CONTROL_JUST_RELEASED(0, (int)ControllerInputs::INPUT_VEH_MOVE_LEFT_ONLY))
{
queued_left_turn_signal = std::chrono::system_clock::now();
}
if (PAD::IS_CONTROL_JUST_RELEASED(0, (int)ControllerInputs::INPUT_VEH_MOVE_RIGHT_ONLY))
{
queued_right_turn_signal = std::chrono::system_clock::now();
}
}
}
virtual void on_disable() override
{
if (self::veh)
{
VEHICLE::SET_VEHICLE_INDICATOR_LIGHTS(self::veh, 0, 0);
VEHICLE::SET_VEHICLE_INDICATOR_LIGHTS(self::veh, 1, 0);
}
}
};
turn_signals g_turn_signals("turnsignals", "Turn Signals", "Makes your car invisible", g.vehicle.turn_signals);
}

View File

@ -1,52 +1,71 @@
#include "backend/looped/looped.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
#include "util/misc.hpp"
namespace big
{
static uint32_t last_bits = 0;
static float last_water_collistion_strength = 0;
static bool last_driving;
void looped::vehicle_god_mode()
class vehicle_godmode_internal : looped_command
{
if (g_local_player == nullptr || g_local_player->m_vehicle == nullptr)
using looped_command::looped_command;
uint32_t last_bits = 0;
float last_water_collistion_strength = 0;
bool last_driving = false;
virtual void on_tick() override
{
return;
if (g_local_player == nullptr || g_local_player->m_vehicle == nullptr)
{
return;
}
if (!PED::GET_PED_CONFIG_FLAG(self::ped, 62, false))
{
if (last_driving)
{
g_local_player->m_vehicle->m_deform_god = 0x9C;
g_local_player->m_vehicle->m_damage_bits = 0;
}
last_driving = false;
return;
}
last_driving = true;
if (g.vehicle.god_mode || g.vehicle.proof_collision)
{
g_local_player->m_vehicle->m_deform_god = 0x8C;
}
else
{
g_local_player->m_vehicle->m_deform_god = 0x9C;
}
uint32_t bits = g.vehicle.proof_mask;
uint32_t changed_bits = bits ^ last_bits;
uint32_t changed_or_enabled_bits = bits | changed_bits;
if (changed_or_enabled_bits)
{
uint32_t unchanged_bits = g_local_player->m_vehicle->m_damage_bits & ~changed_or_enabled_bits;
g_local_player->m_vehicle->m_damage_bits = unchanged_bits | bits;
last_bits = bits;
}
}
if (!PED::GET_PED_CONFIG_FLAG(self::ped, 62, false))
virtual void on_disable() override
{
if (last_driving)
if (g_local_player && g_local_player->m_vehicle)
{
g_local_player->m_vehicle->m_deform_god = 0x9C;
g_local_player->m_vehicle->m_damage_bits = 0;
}
last_driving = false;
return;
}
};
last_driving = true;
if (g.vehicle.god_mode || g.vehicle.proof_collision)
{
g_local_player->m_vehicle->m_deform_god = 0x8C;
}
else
{
g_local_player->m_vehicle->m_deform_god = 0x9C;
}
uint32_t bits = g.vehicle.proof_mask;
uint32_t changed_bits = bits ^ last_bits;
uint32_t changed_or_enabled_bits = bits | changed_bits;
if (changed_or_enabled_bits)
{
uint32_t unchanged_bits = g_local_player->m_vehicle->m_damage_bits & ~changed_or_enabled_bits;
g_local_player->m_vehicle->m_damage_bits = unchanged_bits | bits;
last_bits = bits;
}
}
static bool true_ref = true;
vehicle_godmode_internal g_vehicle_godmode_internal("$$vehgodmode", "", "", true_ref);
bool_command g_vehicle_godmode("vehgodmode", "Vehicle God Mode", "Prevents your vehicle from taking any form of damage",
g.vehicle.god_mode);
}

View File

@ -10,7 +10,8 @@ namespace big
virtual void on_tick() override
{
if (self::veh && PAD::IS_CONTROL_JUST_PRESSED(0, (int)ControllerInputs::INPUT_VEH_HANDBRAKE))
PAD::DISABLE_CONTROL_ACTION(0, (int)ControllerInputs::INPUT_VEH_HANDBRAKE, false);
if (self::veh && PAD::IS_DISABLED_CONTROL_JUST_PRESSED(0, (int)ControllerInputs::INPUT_VEH_HANDBRAKE))
{
ENTITY::APPLY_FORCE_TO_ENTITY(self::veh, 1, 0.0, 0.0, 20, 0.0, 0.0, 0.0, 0, 0, 1, 1, 0, 1);
}

View File

@ -17,31 +17,31 @@ namespace big
float local_fov_change = g.weapons.aimbot.fov;
for (auto ped : entity::get_entities(false, true))
{
if (ENTITY::HAS_ENTITY_CLEAR_LOS_TO_ENTITY(self::ped, ped, 17) && !ENTITY::IS_ENTITY_DEAD(ped, 0))// Tracetype is always 17. LOS check
if (!ENTITY::IS_ENTITY_DEAD(ped, 0)) // Tracetype is always 17. LOS check
{
int relation = PED::GET_RELATIONSHIP_BETWEEN_PEDS(ped, self::ped);// relation for enemy check
int type = PED::GET_PED_TYPE(ped);// for police check, cop types are 6, swat is 27
int relation = PED::GET_RELATIONSHIP_BETWEEN_PEDS(ped, self::ped); // relation for enemy check
int type = PED::GET_PED_TYPE(ped); // for police check, cop types are 6, swat is 27
Vector3 world_position = ENTITY::GET_ENTITY_COORDS(ped, false);
if (SYSTEM::VDIST(self::pos.x,
if (SYSTEM::VDIST2(self::pos.x,
self::pos.y,
self::pos.z,
world_position.x,
world_position.y,
world_position.z)
> g.weapons.aimbot.distance)
continue;// If the entity is further than our preset distance then just skip it
> (g.weapons.aimbot.distance * g.weapons.aimbot.distance))
continue; // If the entity is further than our preset distance then just skip it
if (PED::IS_PED_A_PLAYER(ped) && g.weapons.aimbot.on_player)// check if its a player
if (PED::IS_PED_A_PLAYER(ped) && g.weapons.aimbot.on_player) // check if its a player
{
goto aimbot_handler;
}
else if (((relation == 4) || (relation == 5)) && g.weapons.aimbot.on_enemy)// relation 4 and 5 are for enemies
else if (((relation == 4) || (relation == 5)) && g.weapons.aimbot.on_enemy) // relation 4 and 5 are for enemies
{
goto aimbot_handler;
}
else if (((type == 6 && !PED::IS_PED_MODEL(ped, rage::joaat("s_m_y_uscg_01"))) || type == 27 ||// s_m_y_uscg_01 = us coast guard 1 (techniaclly military)
PED::IS_PED_MODEL(ped, rage::joaat("s_m_y_ranger_01")) || PED::IS_PED_MODEL(ped, rage::joaat("s_f_y_ranger_01")))// ranger models
else if (((type == 6 && !PED::IS_PED_MODEL(ped, rage::joaat("s_m_y_uscg_01"))) || type == 27 || // s_m_y_uscg_01 = us coast guard 1 (technically military)
PED::IS_PED_MODEL(ped, rage::joaat("s_m_y_ranger_01")) || PED::IS_PED_MODEL(ped, rage::joaat("s_f_y_ranger_01"))) // ranger models
&& g.weapons.aimbot.on_police)
{
goto aimbot_handler;
@ -50,10 +50,14 @@ namespace big
// Update aim lock coords
aimbot_handler:
{// Jump to here to handle instead of continue statements
{
if (!ENTITY::HAS_ENTITY_CLEAR_LOS_TO_ENTITY(self::ped, ped, 17))
continue;
// Jump to here to handle instead of continue statements
aim_lock =
ENTITY::GET_WORLD_POSITION_OF_ENTITY_BONE(ped, PED::GET_PED_BONE_INDEX(ped, g.weapons.aimbot.selected_bone));
if ((aim_lock.x != 0) && (aim_lock.y != 0) && (aim_lock.z != 0))// Ensure none of the coords are = to 0
if ((aim_lock.x != 0) && (aim_lock.y != 0) && (aim_lock.z != 0)) // Ensure none of the coords are = to 0
{
Vector2 screen_dim, movement;
GRAPHICS::GET_SCREEN_COORD_FROM_WORLD_COORD(aim_lock.x,
@ -61,22 +65,22 @@ namespace big
aim_lock.z,
&screen_dim.x,
&screen_dim.y);
if ((screen_dim.x >= 0) && (screen_dim.y >= 0))// Make sure updated screen dim is greater than 0
if ((screen_dim.x >= 0) && (screen_dim.y >= 0)) // Make sure updated screen dim is greater than 0
{
auto& io = ImGui::GetIO();
ImVec2 center(io.DisplaySize.x / 2.f, io.DisplaySize.y / 2.f);// Use ImGui to get the display size
ImVec2 center(io.DisplaySize.x / 2.f, io.DisplaySize.y / 2.f); // Use ImGui to get the display size
//Screen dim is a float between 0-1, multiply the float by screen coords
screen_dim.x *= io.DisplaySize.x;
screen_dim.y *= io.DisplaySize.y;
if (screen_dim.x > center.x)//If the location is greater than the center (right side)
{// Get the amount of distance we need to move, so center of the screen - our location
if (screen_dim.x > center.x) //If the location is greater than the center (right side)
{ // Get the amount of distance we need to move, so center of the screen - our location
movement.x = -(center.x - screen_dim.x);
if (movement.x + center.x > center.x * 2)
movement.x = 0;
}
else
{// if the location is on the left side
{ // if the location is on the left side
movement.x = screen_dim.x - center.x;
if (movement.x + center.x < 0)
movement.x = 0;
@ -97,7 +101,7 @@ namespace big
}
if (sqrt(pow(movement.x, 2) + pow(movement.y, 2)) < local_fov_change)
{// sqrt of movment x and y ^ 2, handles fov math
{ // sqrt of movment x and y ^ 2, handles fov math
local_fov_change = sqrt(pow(movement.x, 2) + pow(movement.y, 2));
mouse_movement.x = movement.x;
mouse_movement.y = movement.y;
@ -116,32 +120,32 @@ namespace big
if (update_time_now)
{
current_time = std::chrono::system_clock::now();
update_time_now = false;//lockout
update_time_now = false; //lockout
}
std::chrono::duration<double> elapsed_time = std::chrono::system_clock::now() - current_time;
if (elapsed_time.count() > 0.f)
{
INPUT mouse_handle;// MOUSEINPUT mi;
INPUT mouse_handle; // MOUSEINPUT mi;
mouse_handle.type = INPUT_MOUSE;
mouse_handle.mi.dwFlags = MOUSEEVENTF_MOVE;// Type = Mouse movement, and the event is emulating the mouse movement
mouse_handle.mi.dwFlags = MOUSEEVENTF_MOVE; // Type = Mouse movement, and the event is emulating the mouse movement
// Update the mouse by moving it with how much we need / smoothing speed
mouse_handle.mi.dx = mouse_movement.x / (g.weapons.aimbot.smoothing ? g.weapons.aimbot.smoothing_speed : 2);
mouse_handle.mi.dy = mouse_movement.y / (g.weapons.aimbot.smoothing ? g.weapons.aimbot.smoothing_speed : 2);
SendInput(1, &mouse_handle, sizeof(mouse_handle));//handles the input
SendInput(1, &mouse_handle, sizeof(mouse_handle)); //handles the input
//Reset our variables
mouse_movement.x = 0, mouse_movement.y = 0;
update_time_now = true;//reset our time
update_time_now = true; //reset our time
}
}
}
};
aimbot g_aimbot("aimbot", "Aimbot", "lock on and kill", g.weapons.aimbot.enable);
aimbot g_aimbot("aimbot", "Aimbot", "Lock on and kill", g.weapons.aimbot.enable);
bool_command g_smoothing("smoothing", "Smoothing", "Controls the snappiness of your lock on", g.weapons.aimbot.smoothing);
bool_command g_aimbot_on_player("aimatplayer", "Player", "If you suck at pvp this is for you.", g.weapons.aimbot.on_player);
bool_command g_aimbot_on_player("aimatplayer", "Player", "If you suck at PVP, this is for you", g.weapons.aimbot.on_player);
bool_command g_aimbot_on_npc("aimatnpc", "NPC", "Generally kills normal NPCs", g.weapons.aimbot.on_npc);
bool_command g_aimbot_on_police("aimatpolice", "Police", "Locks onto cops to kill", g.weapons.aimbot.on_police);
bool_command

View File

@ -1,18 +0,0 @@
#include "backend/looped_command.hpp"
#include "natives.hpp"
namespace big
{
class force_crosshairs : looped_command
{
using looped_command::looped_command;
virtual void on_tick() override
{
HUD::SHOW_HUD_COMPONENT_THIS_FRAME(static_cast<int>(HudComponents::RETICLE));
}
};
force_crosshairs g_force_crosshairs("crosshairs", "Force Crosshairs", "Shows the crosshair even when you are not aiming",
g.weapons.force_crosshairs);// do we need this?
}

View File

@ -1,5 +1,5 @@
#include "natives.hpp"
#include "backend/looped_command.hpp"
#include "natives.hpp"
namespace big
{
@ -10,20 +10,13 @@ namespace big
virtual void on_tick() override
{
if (g.weapons.increased_damage != 1)
if (g.weapons.increased_damage != 1)
{
Hash weapon{};
Hash weapon{};
WEAPON::GET_CURRENT_PED_WEAPON(self::ped, &weapon, 0);
WEAPON::SET_WEAPON_DAMAGE_MODIFIER(weapon, g.weapons.increased_damage);
}
}
virtual void on_disable() override
{
Hash weapon{};
WEAPON::GET_CURRENT_PED_WEAPON(self::ped, &weapon, 0);
WEAPON::SET_WEAPON_DAMAGE_MODIFIER(weapon, 1);
}
};
increased_damage

View File

@ -20,15 +20,18 @@ namespace big
if (g_local_player->m_weapon_manager)
{
if (p_modified_weapon != g_local_player->m_weapon_manager->m_weapon_info
&& g_local_player->m_weapon_manager->m_weapon_info)
if (p_modified_weapon != g_local_player->m_weapon_manager->m_weapon_info)
{
if (p_modified_weapon)
p_modified_weapon->m_weapon_range = og_range;
og_range = g_local_player->m_weapon_manager->m_weapon_info->m_weapon_range;
p_modified_weapon = g_local_player->m_weapon_manager->m_weapon_info;
g_local_player->m_weapon_manager->m_weapon_info->m_weapon_range = 1000.0f;
if (g_local_player->m_weapon_manager->m_weapon_info)
{
og_range = g_local_player->m_weapon_manager->m_weapon_info->m_weapon_range;
g_local_player->m_weapon_manager->m_weapon_info->m_weapon_range = 1000.0f;
}
}
}
}

View File

@ -21,14 +21,18 @@ namespace big
auto* const weapon_mgr = g_local_player->m_weapon_manager;
if (weapon_mgr)
{
if (p_modified_weapon != weapon_mgr->m_weapon_info && weapon_mgr->m_weapon_info)
if (p_modified_weapon != weapon_mgr->m_weapon_info)
{
if (p_modified_weapon)
p_modified_weapon->m_explosion_shake_amplitude = og_recoil_value;
og_recoil_value = weapon_mgr->m_weapon_info->m_explosion_shake_amplitude;
p_modified_weapon = weapon_mgr->m_weapon_info;
weapon_mgr->m_weapon_info->m_explosion_shake_amplitude = 0.0f;
if (weapon_mgr->m_weapon_info)
{
og_recoil_value = weapon_mgr->m_weapon_info->m_explosion_shake_amplitude;
weapon_mgr->m_weapon_info->m_explosion_shake_amplitude = 0.0f;
}
}
}
}

View File

@ -21,14 +21,18 @@ namespace big
auto* const weapon_mgr = g_local_player->m_weapon_manager;
if (weapon_mgr)
{
if (p_modified_weapon != weapon_mgr->m_weapon_info && weapon_mgr->m_weapon_info)
if (p_modified_weapon != weapon_mgr->m_weapon_info)
{
if (p_modified_weapon)
p_modified_weapon->m_accuracy_spread = og_spread_value;
og_spread_value = weapon_mgr->m_weapon_info->m_accuracy_spread;
p_modified_weapon = weapon_mgr->m_weapon_info;
weapon_mgr->m_weapon_info->m_accuracy_spread = 0.0f;
p_modified_weapon = weapon_mgr->m_weapon_info;
if (weapon_mgr->m_weapon_info)
{
og_spread_value = weapon_mgr->m_weapon_info->m_accuracy_spread;
weapon_mgr->m_weapon_info->m_accuracy_spread = 0.0f;
}
}
}
}

View File

@ -7,7 +7,6 @@
namespace big
{
class blackhole : looped_command
{
using looped_command::looped_command;
@ -64,10 +63,10 @@ namespace big
}
};
blackhole g_blackhole("blackhole", "Blackhole", "Spawns a black hole that picks up all the peds and vehicles in your area.",
blackhole g_blackhole("blackhole", "Blackhole", "Spawns a blackhole 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",
bool_command g_blackhole_peds("blackholeincpeds", "Peds", "Includes all nearby peds in the blackhole's 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",
bool_command g_blackhole_vehicles("blackholeincvehs", "Vehicles", "Includes all nearby vehicles in the blackhole's path of destruction",
g.world.blackhole.include_vehicles);
}

View File

@ -3,7 +3,6 @@
namespace big
{
class combative : looped_command
{
using looped_command::looped_command;
@ -12,14 +11,16 @@ namespace big
{
MISC::SET_RIOT_MODE_ENABLED(true);
}
virtual void on_tick() override {}
virtual void on_tick() override
{
}
virtual void on_disable() override
{
MISC::SET_RIOT_MODE_ENABLED(false);
}
};
combative g_combative("riotmode", "Riot Mode", "Make nearby peds attack eachother", g.world.nearby.combative);
}
};
combative g_combative("riotmode", "Riot Mode", "Make nearby peds attack each other", g.world.nearby.combative);
}

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