From 2d7db48b53c2214876ffe9cc644419f1a21ba535 Mon Sep 17 00:00:00 2001 From: Yimura Date: Sat, 26 Dec 2020 18:24:08 +0100 Subject: [PATCH] feat(Features): Added no ragdoll looped feature --- BigBaseV2/src/features.cpp | 2 +- BigBaseV2/src/features.hpp | 2 ++ BigBaseV2/src/features/god_mode.cpp | 1 - BigBaseV2/src/features/no_ragdoll.cpp | 24 ++++++++++++++++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 BigBaseV2/src/features/no_ragdoll.cpp diff --git a/BigBaseV2/src/features.cpp b/BigBaseV2/src/features.cpp index b39df5f9..b0d24dfc 100644 --- a/BigBaseV2/src/features.cpp +++ b/BigBaseV2/src/features.cpp @@ -1,4 +1,3 @@ -#include "common.hpp" #include "features.hpp" #include "logger.hpp" #include "natives.hpp" @@ -9,6 +8,7 @@ namespace big void features::run_tick() { god_mode(); + no_ragdoll(); } void features::script_func() diff --git a/BigBaseV2/src/features.hpp b/BigBaseV2/src/features.hpp index e729b4c1..e81615b9 100644 --- a/BigBaseV2/src/features.hpp +++ b/BigBaseV2/src/features.hpp @@ -1,5 +1,6 @@ #pragma once #include "common.hpp" +#include "fiber_pool.hpp" #include "structs/player.hpp" #include "structs/temp.hpp" #include "features/notify.hpp" @@ -23,5 +24,6 @@ namespace big void script_func(); void god_mode(); + void no_ragdoll(); } } diff --git a/BigBaseV2/src/features/god_mode.cpp b/BigBaseV2/src/features/god_mode.cpp index 2e303338..fbaf8bc3 100644 --- a/BigBaseV2/src/features/god_mode.cpp +++ b/BigBaseV2/src/features/god_mode.cpp @@ -1,5 +1,4 @@ #include "features.hpp" -#include "fiber_pool.hpp" namespace big { diff --git a/BigBaseV2/src/features/no_ragdoll.cpp b/BigBaseV2/src/features/no_ragdoll.cpp new file mode 100644 index 00000000..d537917a --- /dev/null +++ b/BigBaseV2/src/features/no_ragdoll.cpp @@ -0,0 +1,24 @@ +#include "features.hpp" + +namespace big +{ + static bool bLastNoRagdoll = false; + + void features::no_ragdoll() + { + bool bNoRagdoll = g_settings.options["ragdoll"].get(); + + if (bNoRagdoll || (!bNoRagdoll && bNoRagdoll != bLastNoRagdoll)) + { + QUEUE_JOB_BEGIN_CLAUSE(= ) + { + Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); + + PED::SET_PED_CAN_RAGDOLL(player, !bNoRagdoll); + PED::SET_PED_CAN_RAGDOLL_FROM_PLAYER_IMPACT(player, !bNoRagdoll); + }QUEUE_JOB_END_CLAUSE + + bLastNoRagdoll = bNoRagdoll; + } + } +} \ No newline at end of file