feat(Self): Added no ragdoll

This commit is contained in:
Yimura 2021-05-21 00:52:59 +02:00
parent b8416192c8
commit 05f591fb9c
5 changed files with 29 additions and 1 deletions

View File

@ -12,6 +12,7 @@ namespace big
QUEUE_JOB_BEGIN_CLAUSE()
{
looped::self_godmode();
looped::self_no_ragdoll();
}QUEUE_JOB_END_CLAUSE
QUEUE_JOB_BEGIN_CLAUSE()

View File

@ -7,6 +7,7 @@ namespace big
public:
static void self_godmode();
static void self_noclip();
static void self_no_ragdoll();
static void weapons_cage_gun();
static void weapons_delete_gun();

View File

@ -0,0 +1,21 @@
#include "backend/looped/looped.hpp"
#include "natives.hpp"
namespace big
{
static bool bLastNoRagdoll = false;
void looped::self_no_ragdoll()
{
bool bNoRagdoll = g.self.no_ragdoll;
Ped player = PLAYER::PLAYER_PED_ID();
if ((bNoRagdoll && PED::IS_PED_RUNNING_RAGDOLL_TASK(player)) || (!bNoRagdoll && bNoRagdoll != bLastNoRagdoll))
{
if (ENTITY::GET_ENTITY_HEIGHT_ABOVE_GROUND(player) < 1.0)
TASK::CLEAR_PED_TASKS_IMMEDIATELY(player);
bLastNoRagdoll = bNoRagdoll;
}
}
}

View File

@ -12,6 +12,7 @@ struct globals {
struct self {
bool godmode = false;
bool noclip = false;
bool no_ragdoll = false;
};
struct vehicle {
@ -31,6 +32,7 @@ struct globals {
void from_json(const nlohmann::json& j)
{
this->self.godmode = j["self"]["godmode"];
this->self.no_ragdoll = j["self"]["no_ragdoll"];
this->vehicle.horn_boost = j["vehicle"]["horn_boost"];
this->vehicle.speedo_meter = (SpeedoMeter)j["vehicle"]["speedo_meter"];
@ -43,7 +45,8 @@ struct globals {
return nlohmann::json{
{
"self", {
{ "godmode", this->self.godmode }
{ "godmode", this->self.godmode },
{ "no_ragdoll", this->self.no_ragdoll }
}
},
{
@ -110,6 +113,7 @@ struct globals {
return true;
}
private:
bool save()
{
std::string settings_file = std::getenv("appdata");

View File

@ -8,6 +8,7 @@ namespace big
{
ImGui::Checkbox("God Mode", &g.self.godmode);
ImGui::Checkbox("No Clip", &g.self.noclip);
ImGui::Checkbox("No Ragdoll", &g.self.no_ragdoll);
ImGui::EndTabItem();
}