-
Автор темы
- #1
Привет!
В данном коде есть выбор материла если что
И анимация пропадения
Как мы делаем
1. Заходим в other_esp.cpp и вставляем
2. Заходим в other_esp.h и вставляем
что бы получилось вот так
3. создаем конфиги
4. Хукаем функцию в hooked_postscreeneffects.cpp
Что бы получилось вот так
5. В menu.cpp
В данном коде есть выбор материла если что
И анимация пропадения
Как мы делаем
1. Заходим в other_esp.cpp и вставляем
Код:
IMaterial* CreateMaterials(bool lit, const std::string& material_data)
{
static auto created = 0;
std::string type = lit ? crypt_str("VertexLitGeneric") : crypt_str("UnlitGeneric");
auto matname = crypt_str("really_") + std::to_string(created);
++created;
auto keyValues = new KeyValues(matname.c_str());
static auto key_values_address = util::FindSignature(crypt_str("client.dll"), crypt_str("55 8B EC 51 33 C0 C7 45"));
using KeyValuesFn = void(__thiscall*)(void*, const char*);
reinterpret_cast <KeyValuesFn> (key_values_address)(keyValues, type.c_str());
static auto load_from_buffer_address = util::FindSignature(crypt_str("client.dll"), crypt_str("55 8B EC 83 E4 F8 83 EC 34 53 8B 5D 0C 89"));
using LoadFromBufferFn = void(__thiscall*)(void*, const char*, const char*, void*, const char*, void*);
reinterpret_cast <LoadFromBufferFn> (load_from_buffer_address)(keyValues, matname.c_str(), material_data.c_str(), nullptr, nullptr, nullptr);
auto material = m_materialsystem()->CreateMaterial(matname.c_str(), keyValues);
material->IncrementReferenceCount();
return material;
}
void otheresp::draw_hit_matrix()
{
if (!m_engine()->IsInGame() && !m_engine()->IsConnected())
return;
if (!g_ctx.available())
m_Hitmatrix.clear();
if (m_Hitmatrix.size() > 12)
m_Hitmatrix.clear();
if (m_Hitmatrix.empty())
return;
if (!m_modelrender())
return;
auto ctx = m_materialsystem()->GetRenderContext();
if (!ctx)
return;
auto it = m_Hitmatrix.begin();
while (it != m_Hitmatrix.end()) {
if (!it->state.m_pModelToWorld || !it->state.m_pRenderable || !it->state.m_pStudioHdr || !it->state.m_pStudioHWData ||
!it->info.pRenderable || !it->info.pModelToWorld || !it->info.pModel) {
++it;
continue;
}
auto alpha = 1.0f;
auto delta = m_globals()->m_realtime - it->time;
if (delta > 0.0f) {
alpha -= delta;
if (delta > 1.0f) {
it = m_Hitmatrix.erase(it);
continue;
}
}
static IMaterial* materials[] =
{
CreateMaterials(true, crypt_str(R"#("VertexLitGeneric"
{
"$basetexture" "vgui/white"
"$ignorez" "0"
"$envmap" " "
"$nofog" "1"
"$model" "1"
"$nocull" "0"
"$selfillum" "1"
"$halflambert" "1"
"$znearer" "0"
"$flat" "0"
"$wireframe" "0"
}
)#")),
CreateMaterials(true, crypt_str(R"#("VertexLitGeneric"
{
"$basetexture" "vgui/white"
"$ignorez" "0"
"$envmap" "env_cubemap"
"$normalmapalphaenvmapmask" "1"
"$envmapcontrast" "1"
"$nofog" "1"
"$model" "1"
"$nocull" "0"
"$selfillum" "1"
"$halflambert" "1"
"$znearer" "0"
"$flat" "1"
"$wireframe" "0"
}
)#")),
CreateMaterials(false, crypt_str(R"#("UnlitGeneric"
{
"$basetexture" "vgui/white"
"$ignorez" "0"
"$envmap" " "
"$nofog" "1"
"$model" "1"
"$nocull" "0"
"$selfillum" "1"
"$halflambert" "1"
"$znearer" "0"
"$flat" "1"
"$wireframe" "0"
}
)#")),
m_materialsystem()->FindMaterial(crypt_str("models/inventory_items/dogtags/dogtags_outline"), nullptr), //-V807
m_materialsystem()->FindMaterial(crypt_str("models/inventory_items/trophy_majors/crystal_clear"), nullptr),
m_materialsystem()->FindMaterial(crypt_str("models/inventory_items/cologne_prediction/cologne_prediction_glass"), nullptr),
m_materialsystem()->FindMaterial(crypt_str("dev/glow_armsrace.vmt"), nullptr),
CreateMaterials(true, crypt_str(R"#("VertexLitGeneric"
{
"$additive" "1"
"$envmap" "models/effects/cube_white"
"$envmaptint" "[1 1 1]"
"$envmapfresnel" "1"
"$envmapfresnelminmaxexp" "[0 1 2]"
"$alpha" "0.8"
}
)#")),
CreateMaterials(true, crypt_str(R"#("VertexLitGeneric"
{
"$basetexture" "dev/zone_warning"
"$additive" "1"
"$envmap" "editor/cube_vertigo"
"$envmaptint" "[0 0.5 0.55]"
"$envmapfresnel" "1"
"$envmapfresnelminmaxexp" "[0.00005 0.6 6]"
"$alpha" "1"
Proxies
{
TextureScroll
{
"texturescrollvar" "$baseTextureTransform"
"texturescrollrate" "0.25"
"texturescrollangle" "270"
}
Sine
{
"sineperiod" "2"
"sinemin" "0.1"
"resultVar" "$envmapfresnelminmaxexp[1]"
}
}
}
)#"))
};
auto material = materials[g_cfg.player.lag_material];
auto alpha_c = (float)g_cfg.player.lag_hitbox_color.a() / 255.0f;
float normal_color[3] =
{
g_cfg.player.lag_hitbox_color[0] / 255.0f,
g_cfg.player.lag_hitbox_color[1] / 255.0f,
g_cfg.player.lag_hitbox_color[2] / 255.0f
};
m_renderview()->SetBlend(alpha_c * alpha);
util::color_modulate(normal_color, material);
material->IncrementReferenceCount();
material->SetMaterialVarFlag(MATERIAL_VAR_IGNOREZ, true);
m_modelrender()->ForcedMaterialOverride(material);
m_modelrender()->DrawModelExecute(ctx, it->state, it->info, it->pBoneToWorld);
m_modelrender()->ForcedMaterialOverride(nullptr);
++it;
}
}
Код:
void draw_hit_matrix();
struct C_HitMatrixEntry {
int ent_index;
ModelRenderInfo_t info;
DrawModelState_t state;
matrix3x4_t pBoneToWorld[128] = {};
float time;
matrix3x4_t model_to_world;
} m_hit_matrix;
std::vector<C_HitMatrixEntry> m_Hitmatrix;
3. создаем конфиги
Код:
int lag_material;
setup_item(&g_cfg.player.lag_material, 7, crypt_str("Player.lag_hitbox_material"));
Код:
if (g_cfg.player.lag_hitbox)[/FONT][/SIZE][/COLOR][/CENTER]
[COLOR=rgb(204, 204, 204)][SIZE=4][FONT=arial][CENTER] otheresp::get().draw_hit_matrix();
5. В menu.cpp
Код:
draw_combo(crypt_str("Shot chams material"), g_cfg.player.lag_material, chamstype, 9);
6. Компилим
SS:[/CENTER]