-
Автор темы
- #1
Paste in hooked_dme.cpp at line 57-
replace the line at 61-
replace the line at 66-
now add this at line 810-
Код:
auto weapon_on_back = strstr(name, "_dropped.mdl") && strstr(name, "models/weapons/w") && !strstr(name, "arms") && !strstr(name, "ied_dropped") && g_cfg.esp.attachment_chams;
auto weapon_enemy_hands = strstr(name, "models/weapons/w") && !strstr(name, "arms") && !strstr(name, "ied_dropped") && g_cfg.esp.attachment_chams;
auto defuse_kit = strstr(name, "defuser") && !strstr(name, "arms") && !strstr(name, "ied_dropped") && g_cfg.esp.attachment_chams;
Код:
if (m_modelrender()->IsForcedMaterialOverride() && !is_weapon && !is_arms && !is_sleeve && !weapon_on_back && !weapon_enemy_hands && !defuse_kit)
Код:
if (!is_player && !is_weapon && !is_arms && !is_sleeve && !weapon_on_back && !weapon_enemy_hands && !defuse_kit)
Код:
else if (weapon_on_back)
{
auto alpha = (float)g_cfg.esp.attachment_chams_color.a() / 255.0f;
auto material = materials[g_cfg.esp.attachment_chams_material];
auto double_material = materials[6];
if (material && double_material && !material->IsErrorMaterial() && !double_material->IsErrorMaterial())
{
float attachment_color[3] =
{
g_cfg.esp.attachment_chams_color[0] / 255.0f,
g_cfg.esp.attachment_chams_color[1] / 255.0f,
g_cfg.esp.attachment_chams_color[2] / 255.0f
};
m_renderview()->SetBlend(alpha);
util::color_modulate(attachment_color, material);
material->IncrementReferenceCount();
material->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, false);
m_modelrender()->ForcedMaterialOverride(material);
original_fn(m_modelrender(), ctx, state, info, bone_to_world);
m_modelrender()->ForcedMaterialOverride(nullptr);
if (g_cfg.esp.attachment_double_material && g_cfg.esp.attachment_chams_material != 6)
{
alpha = (float)g_cfg.esp.attachment_double_material_color.a() / 255.0f;
float double_color[3] =
{
g_cfg.esp.attachment_double_material_color[0] / 255.0f,
g_cfg.esp.attachment_double_material_color[1] / 255.0f,
g_cfg.esp.attachment_double_material_color[2] / 255.0f
};
m_renderview()->SetBlend(alpha);
util::color_modulate(double_color, double_material);
double_material->IncrementReferenceCount();
double_material->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, false);
m_modelrender()->ForcedMaterialOverride(double_material);
original_fn(m_modelrender(), ctx, state, info, bone_to_world);
m_modelrender()->ForcedMaterialOverride(nullptr);
}
called_original = true;
}
if (!called_original)
return original_fn(m_modelrender(), ctx, state, info, bone_to_world);
}
else if (weapon_enemy_hands)
{
auto alpha = (float)g_cfg.esp.attachment_chams_color.a() / 255.0f;
auto material = materials[g_cfg.esp.attachment_chams_material];
auto double_material = materials[6];
if (material && double_material && !material->IsErrorMaterial() && !double_material->IsErrorMaterial())
{
float attachment_color[3] =
{
g_cfg.esp.attachment_chams_color[0] / 255.0f,
g_cfg.esp.attachment_chams_color[1] / 255.0f,
g_cfg.esp.attachment_chams_color[2] / 255.0f
};
m_renderview()->SetBlend(alpha);
util::color_modulate(attachment_color, material);
material->IncrementReferenceCount();
material->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, false);
m_modelrender()->ForcedMaterialOverride(material);
original_fn(m_modelrender(), ctx, state, info, bone_to_world);
m_modelrender()->ForcedMaterialOverride(nullptr);
if (g_cfg.esp.attachment_double_material && g_cfg.esp.attachment_chams_material != 6)
{
alpha = (float)g_cfg.esp.attachment_double_material_color.a() / 255.0f;
float double_color[3] =
{
g_cfg.esp.attachment_double_material_color[0] / 255.0f,
g_cfg.esp.attachment_double_material_color[1] / 255.0f,
g_cfg.esp.attachment_double_material_color[2] / 255.0f
};
m_renderview()->SetBlend(alpha);
util::color_modulate(double_color, double_material);
double_material->IncrementReferenceCount();
double_material->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, false);
m_modelrender()->ForcedMaterialOverride(double_material);
original_fn(m_modelrender(), ctx, state, info, bone_to_world);
m_modelrender()->ForcedMaterialOverride(nullptr);
}
called_original = true;
}
if (!called_original)
return original_fn(m_modelrender(), ctx, state, info, bone_to_world);
}
else if (defuse_kit)
{
auto alpha = (float)g_cfg.esp.attachment_chams_color.a() / 255.0f;
auto material = materials[g_cfg.esp.attachment_chams_material];
auto double_material = materials[6];
if (material && double_material && !material->IsErrorMaterial() && !double_material->IsErrorMaterial())
{
float attachment_color[3] =
{
g_cfg.esp.attachment_chams_color[0] / 255.0f,
g_cfg.esp.attachment_chams_color[1] / 255.0f,
g_cfg.esp.attachment_chams_color[2] / 255.0f
};
m_renderview()->SetBlend(alpha);
util::color_modulate(attachment_color, material);
material->IncrementReferenceCount();
material->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, false);
m_modelrender()->ForcedMaterialOverride(material);
original_fn(m_modelrender(), ctx, state, info, bone_to_world);
m_modelrender()->ForcedMaterialOverride(nullptr);
if (g_cfg.esp.attachment_double_material && g_cfg.esp.attachment_chams_material != 6)
{
alpha = (float)g_cfg.esp.attachment_double_material_color.a() / 255.0f;
float double_color[3] =
{
g_cfg.esp.attachment_double_material_color[0] / 255.0f,
g_cfg.esp.attachment_double_material_color[1] / 255.0f,
g_cfg.esp.attachment_double_material_color[2] / 255.0f
};
m_renderview()->SetBlend(alpha);
util::color_modulate(double_color, double_material);
double_material->IncrementReferenceCount();
double_material->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, false);
m_modelrender()->ForcedMaterialOverride(double_material);
original_fn(m_modelrender(), ctx, state, info, bone_to_world);
m_modelrender()->ForcedMaterialOverride(nullptr);
}
called_original = true;
}
if (!called_original)
return original_fn(m_modelrender(), ctx, state, info, bone_to_world);
}