From 94692bf6ec0d6efd854704d9ce84021510a34217 Mon Sep 17 00:00:00 2001 From: Yimura Date: Sat, 26 Dec 2020 19:39:24 +0100 Subject: [PATCH] feat(Features): Added super sprint looped feature --- BigBaseV2/src/features.cpp | 3 +- BigBaseV2/src/features.hpp | 3 +- BigBaseV2/src/features/super_sprint.cpp | 37 +++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 BigBaseV2/src/features/super_sprint.cpp diff --git a/BigBaseV2/src/features.cpp b/BigBaseV2/src/features.cpp index 78bb6014..e2b8d9a0 100644 --- a/BigBaseV2/src/features.cpp +++ b/BigBaseV2/src/features.cpp @@ -14,8 +14,9 @@ namespace big god_mode(); never_wanted(); - off_radar(); no_ragdoll(); + off_radar(); + super_sprint(); } void features::script_func() diff --git a/BigBaseV2/src/features.hpp b/BigBaseV2/src/features.hpp index 2b2ed03a..cdfcd763 100644 --- a/BigBaseV2/src/features.hpp +++ b/BigBaseV2/src/features.hpp @@ -25,8 +25,9 @@ namespace big void god_mode(); void never_wanted(); - void off_radar(); void no_ragdoll(); + void off_radar(); + void super_sprint(); void update_screen_sizes(); void update_player_structs(); diff --git a/BigBaseV2/src/features/super_sprint.cpp b/BigBaseV2/src/features/super_sprint.cpp new file mode 100644 index 00000000..4ebd8447 --- /dev/null +++ b/BigBaseV2/src/features/super_sprint.cpp @@ -0,0 +1,37 @@ +#include "features.hpp" + +namespace big +{ + static bool bLastSuperSprint = false; + + void features::super_sprint() + { + bool bSuperSprint = g_settings.options["super_sprint"].get(); + + if (bSuperSprint) + { + QUEUE_JOB_BEGIN_CLAUSE(= ) + { + if (PAD::IS_CONTROL_PRESSED(0, 32)) + { + Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + + Vector3 offset = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0, 0.6, 0); + ENTITY::APPLY_FORCE_TO_ENTITY(player, 1, 0.0f, 1.3, 0, 0.0f, 0.0f, 0.0f, 0, 1, 1, 1, 0, 1); + + PLAYER::SET_PLAYER_SPRINT(g_playerId, 1); + PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_playerId, 1.49); + } + }QUEUE_JOB_END_CLAUSE + } + else if (!bSuperSprint && bSuperSprint != bLastSuperSprint) + { + QUEUE_JOB_BEGIN_CLAUSE(= ) + { + PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_playerId, 1.0); + }QUEUE_JOB_END_CLAUSE + } + + bLastSuperSprint = bSuperSprint; + } +} \ No newline at end of file