feat(Self): Added frame flag support

This commit is contained in:
Yimura 2021-02-21 00:18:31 +01:00
parent 4c2fd7f148
commit 758f0f4e19
No known key found for this signature in database
GPG Key ID: 54EFAD29393A6E78
8 changed files with 55 additions and 8 deletions

View File

@ -69,6 +69,8 @@ namespace big
inline std::atomic_bool g_running{ true };
// Global Variables
inline CPed* g_local_ped;
inline player g_player;
inline player g_selectedPlayer;
inline std::unordered_map<Player, player> g_players;

View File

@ -0,0 +1,25 @@
#include "features/self.hpp"
#include "gta/enums.hpp"
namespace big
{
void self::frame_flags()
{
if (g_local_ped == nullptr) return;
uint32_t& flags = g_local_ped->m_player_info->m_frame_flags;
auto& frame_flags = g_settings.options["frame_flags"];
if (frame_flags["explosive_ammo"])
flags |= eFrameFlagExplosiveAmmo;
if (frame_flags["explosive_melee"])
flags |= eFrameFlagExplosiveMelee;
if (frame_flags["fire_ammo"])
flags |= eFrameFlagFireAmmo;
if (frame_flags["super_jump"])
flags |= eFrameFlagSuperJump;
}
}

View File

@ -11,9 +11,7 @@ namespace big
if (bGodMode || (!bGodMode && bGodMode != bLastGodMode))
{
CPed* ped = gta_util::get_local_ped();
ped->m_godmode = bGodMode ? 0x1 : 0x0;
g_local_ped->m_godmode = bGodMode ? 0x1 : 0x0;
//ENTITY::SET_ENTITY_INVINCIBLE(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player.id), bGodMode);

View File

@ -8,12 +8,12 @@ namespace big
void vehicle::handling()
{
CPed* ped = gta_util::get_local_ped();
if (g_local_ped == nullptr) return;
g_temp.in_vehicle = ped->m_in_vehicle == 0;
g_temp.in_vehicle = g_local_ped->m_in_vehicle == 0;
if (g_temp.in_vehicle)
g_vehicle = ped->m_vehicle;
g_vehicle = g_local_ped->m_vehicle;
else
g_vehicle = nullptr;
}

View File

@ -1,5 +1,6 @@
#include "self.hpp"
#include "fiber_pool.hpp"
#include "gta_util.hpp"
#include "script.hpp"
namespace big
@ -8,6 +9,8 @@ namespace big
void self::loop()
{
g_local_ped = gta_util::get_local_ped();
if (busy) return;
busy = true;
@ -19,6 +22,7 @@ namespace big
noclip();
off_radar();
spoof_rank();
frame_flags();
super_sprint();
busy = false;

View File

@ -16,6 +16,7 @@ namespace big
static void off_radar();
static void spoof_rank();
static void super_sprint();
static void frame_flags();
};
}

View File

@ -26,6 +26,18 @@ namespace big
ImGui::Separator();
if (ImGui::TreeNode("Frame Flags"))
{
auto& frame_flags = g_settings.options["frame_flags"];
ImGui::Checkbox("Explosive Ammo", frame_flags["explosive_ammo"].get<bool*>());
ImGui::Checkbox("Explosive Melee", frame_flags["explosive_melee"].get<bool*>());
ImGui::Checkbox("Fire Ammo", frame_flags["fire_ammo"].get<bool*>());
ImGui::Checkbox("Super Jump", frame_flags["super_jump"].get<bool*>());
ImGui::TreePop();
}
if (ImGui::TreeNode("No Clip"))
{
if (ImGui::Checkbox("No Clip", g_settings.options["noclip"]["enabled"].get<bool*>()))
@ -39,7 +51,6 @@ namespace big
ImGui::TreePop();
}
ImGui::Separator();
if (ImGui::Checkbox("God Mode", g_settings.options["god_mode"].get<bool*>()) || ImGui::Checkbox("No Ragdoll", g_settings.options["ragdoll"].get<bool*>()))
g_settings.save();

View File

@ -20,6 +20,12 @@ namespace big
},
"disable_phone": false,
"disable_chat_censoring": false,
"frame_flags": {
"explosive_ammo": false,
"explosive_melee": false,
"fire_ammo": false,
"super_jump": false
},
"god_mode": false,
"join_message": false,
"never_wanted": false,