Added entity proofs (#304)
This commit is contained in:
parent
60911e657b
commit
51d03c8883
@ -3,17 +3,19 @@
|
|||||||
|
|
||||||
namespace big
|
namespace big
|
||||||
{
|
{
|
||||||
static bool bLastGodMode = false;
|
static uint32_t lastProofBits = 0;
|
||||||
|
|
||||||
void looped::self_godmode()
|
void looped::self_godmode() {
|
||||||
{
|
if (g_local_player != nullptr) {
|
||||||
bool bGodMode = g->self.godmode;
|
uint32_t proofBits = g->self.proof_mask;
|
||||||
|
uint32_t changedProofBits = proofBits ^ lastProofBits;
|
||||||
|
uint32_t changedOrEnabledProofBits = proofBits | changedProofBits;
|
||||||
|
|
||||||
if (bGodMode || (!bGodMode && bGodMode != bLastGodMode))
|
if (changedOrEnabledProofBits) {
|
||||||
{
|
uint32_t unchangedBits = g_local_player->m_damage_bits & ~changedOrEnabledProofBits;
|
||||||
ENTITY::SET_ENTITY_INVINCIBLE(self::ped, g->self.godmode);
|
g_local_player->m_damage_bits = unchangedBits | proofBits;
|
||||||
|
lastProofBits = proofBits;
|
||||||
bLastGodMode = g->self.godmode;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -193,4 +193,17 @@ namespace big
|
|||||||
KMH,
|
KMH,
|
||||||
MPH
|
MPH
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class eEntityProofs : uint32_t
|
||||||
|
{
|
||||||
|
BULLET = 1 << 4,
|
||||||
|
FIRE = 1 << 5,
|
||||||
|
COLLISION = 1 << 6,
|
||||||
|
MELEE = 1 << 7,
|
||||||
|
GOD = 1 << 8,
|
||||||
|
EXPLOSION = 1 << 11,
|
||||||
|
STEAM = 1 << 15,
|
||||||
|
DROWN = 1 << 16,
|
||||||
|
WATER = 1 << 24,
|
||||||
|
};
|
||||||
}
|
}
|
@ -142,6 +142,16 @@ namespace big
|
|||||||
bool off_radar = false;
|
bool off_radar = false;
|
||||||
bool super_run = false;
|
bool super_run = false;
|
||||||
int wanted_level = 0;
|
int wanted_level = 0;
|
||||||
|
|
||||||
|
bool proof_bullet = false;
|
||||||
|
bool proof_fire = false;
|
||||||
|
bool proof_collision = false;
|
||||||
|
bool proof_melee = false;
|
||||||
|
bool proof_explosion = false;
|
||||||
|
bool proof_steam = false;
|
||||||
|
bool proof_drown = false;
|
||||||
|
bool proof_water = false;
|
||||||
|
uint32_t proof_mask = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct session
|
struct session
|
||||||
|
@ -23,19 +23,16 @@ namespace big
|
|||||||
});
|
});
|
||||||
|
|
||||||
static char model[32];
|
static char model[32];
|
||||||
components::input_text_with_hint("Model Name###player_ped_model", "Player Model Name", model, sizeof(model), ImGuiInputTextFlags_EnterReturnsTrue, []
|
components::input_text_with_hint("Model Name###player_ped_model", "Player Model Name", model, sizeof(model), ImGuiInputTextFlags_EnterReturnsTrue, [] {
|
||||||
{
|
|
||||||
g_fiber_pool->queue_job([] {
|
g_fiber_pool->queue_job([] {
|
||||||
const Hash hash = rage::joaat(model);
|
const Hash hash = rage::joaat(model);
|
||||||
|
|
||||||
for (uint8_t i = 0; !STREAMING::HAS_MODEL_LOADED(hash) && i < 100; i++)
|
for (uint8_t i = 0; !STREAMING::HAS_MODEL_LOADED(hash) && i < 100; i++) {
|
||||||
{
|
|
||||||
STREAMING::REQUEST_MODEL(hash);
|
STREAMING::REQUEST_MODEL(hash);
|
||||||
|
|
||||||
script::get_current()->yield();
|
script::get_current()->yield();
|
||||||
}
|
}
|
||||||
if (!STREAMING::HAS_MODEL_LOADED(hash))
|
if (!STREAMING::HAS_MODEL_LOADED(hash)) {
|
||||||
{
|
|
||||||
g_notification_service->push_error("Self", "Failed to spawn model, did you give an incorrect model ? ");
|
g_notification_service->push_error("Self", "Failed to spawn model, did you give an incorrect model ? ");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -73,8 +70,7 @@ namespace big
|
|||||||
ImGui::BeginGroup();
|
ImGui::BeginGroup();
|
||||||
|
|
||||||
ImGui::Checkbox("Invisibility", &g->self.invisibility);
|
ImGui::Checkbox("Invisibility", &g->self.invisibility);
|
||||||
if (g->self.invisibility)
|
if (g->self.invisibility) {
|
||||||
{
|
|
||||||
ImGui::Checkbox("Locally Visible", &g->self.local_visibility);
|
ImGui::Checkbox("Locally Visible", &g->self.local_visibility);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,8 +92,99 @@ namespace big
|
|||||||
{
|
{
|
||||||
ImGui::Checkbox("Force Wanted Level", &g->self.force_wanted_level);
|
ImGui::Checkbox("Force Wanted Level", &g->self.force_wanted_level);
|
||||||
ImGui::Text("Wanted Level");
|
ImGui::Text("Wanted Level");
|
||||||
if (ImGui::SliderInt("###wanted_level", &g->self.wanted_level, 0, 5) && !g->self.force_wanted_level)
|
if (
|
||||||
|
ImGui::SliderInt("###wanted_level", &g->self.wanted_level, 0, 5) &&
|
||||||
|
!g->self.force_wanted_level &&
|
||||||
|
g_local_player != nullptr
|
||||||
|
) {
|
||||||
g_local_player->m_player_info->m_wanted_level = g->self.wanted_level;
|
g_local_player->m_player_info->m_wanted_level = g->self.wanted_level;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::Separator();
|
||||||
|
|
||||||
|
components::small_text("Proofs");
|
||||||
|
|
||||||
|
if (ImGui::Button("Check all")) {
|
||||||
|
g->self.proof_bullet = true;
|
||||||
|
g->self.proof_fire = true;
|
||||||
|
g->self.proof_collision = true;
|
||||||
|
g->self.proof_melee = true;
|
||||||
|
g->self.proof_explosion = true;
|
||||||
|
g->self.proof_steam = true;
|
||||||
|
g->self.proof_drown = true;
|
||||||
|
g->self.proof_water = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::SameLine();
|
||||||
|
|
||||||
|
if (ImGui::Button("Uncheck all")) {
|
||||||
|
g->self.proof_bullet = false;
|
||||||
|
g->self.proof_fire = false;
|
||||||
|
g->self.proof_collision = false;
|
||||||
|
g->self.proof_melee = false;
|
||||||
|
g->self.proof_explosion = false;
|
||||||
|
g->self.proof_steam = false;
|
||||||
|
g->self.proof_drown = false;
|
||||||
|
g->self.proof_water = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::BeginGroup();
|
||||||
|
|
||||||
|
ImGui::Checkbox("Bullet", &g->self.proof_bullet);
|
||||||
|
ImGui::Checkbox("Fire", &g->self.proof_fire);
|
||||||
|
|
||||||
|
ImGui::EndGroup();
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::BeginGroup();
|
||||||
|
|
||||||
|
ImGui::Checkbox("Collision", &g->self.proof_collision);
|
||||||
|
ImGui::Checkbox("Melee", &g->self.proof_melee);
|
||||||
|
|
||||||
|
ImGui::EndGroup();
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::BeginGroup();
|
||||||
|
|
||||||
|
ImGui::Checkbox("Explosion", &g->self.proof_explosion);
|
||||||
|
ImGui::Checkbox("Steam", &g->self.proof_steam);
|
||||||
|
|
||||||
|
ImGui::EndGroup();
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::BeginGroup();
|
||||||
|
|
||||||
|
ImGui::Checkbox("Drown", &g->self.proof_drown);
|
||||||
|
ImGui::Checkbox("Water", &g->self.proof_water);
|
||||||
|
|
||||||
|
ImGui::EndGroup();
|
||||||
|
|
||||||
|
g->self.proof_mask = 0;
|
||||||
|
if (g->self.godmode) {
|
||||||
|
g->self.proof_mask |= static_cast<int>(eEntityProofs::GOD);
|
||||||
|
} else {
|
||||||
|
if (g->self.proof_bullet) {
|
||||||
|
g->self.proof_mask |= static_cast<int>(eEntityProofs::BULLET);
|
||||||
|
}
|
||||||
|
if (g->self.proof_fire) {
|
||||||
|
g->self.proof_mask |= static_cast<int>(eEntityProofs::FIRE);
|
||||||
|
}
|
||||||
|
if (g->self.proof_collision) {
|
||||||
|
g->self.proof_mask |= static_cast<int>(eEntityProofs::COLLISION);
|
||||||
|
}
|
||||||
|
if (g->self.proof_melee) {
|
||||||
|
g->self.proof_mask |= static_cast<int>(eEntityProofs::MELEE);
|
||||||
|
}
|
||||||
|
if (g->self.proof_explosion) {
|
||||||
|
g->self.proof_mask |= static_cast<int>(eEntityProofs::EXPLOSION);
|
||||||
|
}
|
||||||
|
if (g->self.proof_steam) {
|
||||||
|
g->self.proof_mask |= static_cast<int>(eEntityProofs::STEAM);
|
||||||
|
}
|
||||||
|
if (g->self.proof_drown) {
|
||||||
|
g->self.proof_mask |= static_cast<int>(eEntityProofs::DROWN);
|
||||||
|
}
|
||||||
|
if (g->self.proof_water) {
|
||||||
|
g->self.proof_mask |= static_cast<int>(eEntityProofs::WATER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user