Escalation Project
-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
C++:
hooks.cpp
void __fastcall Hooks::DrawModelExecute(void* ecx, void* edx, IMatRenderContext* context, const DrawModelState_t& state, const ModelRenderInfo_t& info, matrix3x4_t* matrix)
{
static auto oDrawModelExecute = g_Hooks.pModelHook->GetOriginal<DrawModelExecute_t>(vtable_indexes::dme);
const char* ModelName = g_pModelInfo->GetModelName((model_t*)info.pModel);
C_BaseEntity* pPlayerEntity = g_pEntityList->GetClientEntity(info.index);
if (pPlayerEntity && pPlayerEntity->IsAlive() && !pPlayerEntity->IsDormant() && strstr(ModelName, "models/player") && Globals::LocalPlayer && pPlayerEntity == Globals::LocalPlayer) {
if (Globals::LocalPlayer->IsScoped())
{
g_pRenderView->SetBlend(0.4f);
}
}
static std::vector< IMaterial* > materials;
static unsigned int s, v, i;
static float h, r, g, b, f, p, q, t;
h = g_pGlobalVars->realtime * 0.5f;
s = 1;
v = 1;
i = floor(h * 6);
f = h * 6 - i;
p = v * (1 - s);
q = v * (1 - f * s);
t = v * (1 - (1 - f) * s);
switch (i % 6)
{
case 0: r = v, g = t, b = p; break;
case 1: r = q, g = v, b = p; break;
case 2: r = p, g = v, b = t; break;
case 3: r = p, g = q, b = v; break;
case 4: r = t, g = p, b = v; break;
case 5: r = v, g = p, b = q; break;
}
r = round(r * 255), g = round(g * 255), b = round(b * 255);
static bool once{ false };
if (!once) {
materials.push_back(create_material(true, false, false)); // material.
//materials.push_back(create_material(false, false, false, 0)); // flat.
//materials.push_back(create_material(true, false, true)); // material zignore.
//materials.push_back(create_material(false, false, true)); // flat zignore.
once = true;
}
//float hand_chams[3] = { c_config::get().hand_chams_color_r / 255.f, c_config::get().hand_chams_color_g / 255.f, c_config::get().hand_chams_color_b / 255.f };
//float weapon_chams[3] = { c_config::get().weapon_chams_color_r / 255.f, c_config::get().weapon_chams_color_g / 255.f, c_config::get().weapon_chams_color_b / 255.f };
auto HandChams = c_config::get().hand_chams;
auto WeaponChams = c_config::get().weapon_chams;
auto WeaponrgbChams = c_config::get().weaponrgb_chams;
auto HandrgbChams = c_config::get().handrgb_chams;
if (strstr(ModelName, "arms") && HandChams)
{
//g_pRenderView->SetBlend(c_config::get().hand_chams_color_a / 100.f);
//g_pRenderView->SetColorModulation(hand_chams);
g_pModelRender->ForcedMaterialOverride(materials.at(0));
Color col = Color(c_config::get().hand_chams_color[0] * 255, c_config::get().hand_chams_color[1] * 255, c_config::get().hand_chams_color[2] * 255, c_config::get().hand_chams_color[3] * 255);
bool bFound = false;
auto pVar = materials.at(0)->FindVar("$envmaptint", &bFound);
if (bFound)
(*(void(__thiscall**)(int, float, float, float))(*(DWORD*)pVar + 44))((uintptr_t)pVar, col.red / 255.f, col.green / 255.f, col.blue / 255.f);
}
if (strstr(ModelName, "arms") && HandrgbChams)
{
//g_pRenderView->SetBlend(c_config::get().hand_chams_color_a / 100.f);
//g_pRenderView->SetColorModulation(hand_chams);
g_pModelRender->ForcedMaterialOverride(materials.at(0));
Color col = Color(r, g, b, 255);
bool bFound = false;
auto pVar = materials.at(0)->FindVar("$envmaptint", &bFound);
if (bFound)
(*(void(__thiscall**)(int, float, float, float))(*(DWORD*)pVar + 44))((uintptr_t)pVar, col.red / 255.f, col.green / 255.f, col.blue / 255.f);
}
Color col = Color(r, g, b, 255);
if (strstr(ModelName, "v_") && !strstr(ModelName, "arms") && WeaponChams > 0)
{
g_pModelRender->ForcedMaterialOverride(materials.at(0));
Color col = Color(c_config::get().weapon_chams_color[0] * 255, c_config::get().weapon_chams_color[1] * 255, c_config::get().weapon_chams_color[2] * 255, c_config::get().weapon_chams_color[3] * 255);
bool bFound = false;
auto pVar = materials.at(0)->FindVar("$envmaptint", &bFound);
if (bFound)
(*(void(__thiscall**)(int, float, float, float))(*(DWORD*)pVar + 44))((uintptr_t)pVar, col.red / 255.f, col.green / 255.f, col.blue / 255.f);
}
if (strstr(ModelName, "v_") && !strstr(ModelName, "arms") && WeaponrgbChams > 0)
{
g_pModelRender->ForcedMaterialOverride(materials.at(0));
Color col = Color(r, g, b, 255);
bool bFound = false;
auto pVar = materials.at(0)->FindVar("$envmaptint", &bFound);
if (bFound)
(*(void(__thiscall**)(int, float, float, float))(*(DWORD*)pVar + 44))((uintptr_t)pVar, col.red / 255.f, col.green / 255.f, col.blue / 255.f);
}
oDrawModelExecute(ecx, context, state, info, matrix);
}
C++:
config.h
bool wireframe_arms = false;
bool hand_chams = false;
bool weapon_chams = false;
bool localrgb_chams = false;
bool desyncrgb_chams = false;
bool chamsrgb_enemies = false;
bool handrgb_chams = false;
bool weaponrgb_chams = false;
C++:
ImGui::Checkbox("Chams Weapon", &c_config::get().weapon_chams);
ImGui::ColorEdit3("Weapon color", c_config::get().weapon_chams_color, ImGuiColorEditFlags_NoInputs);
ImGui::Checkbox("Hand Rainbow", &c_config::get().handrgb_chams);
ImGui::Checkbox("Weapon Rainbow", &c_config::get().weaponrgb_chams);