// removed because antipasta
-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
void Misc::PlayerChanger(Stage_t stage) {
if (!g_menu.main.misc.model_changer.get())
return;
static int originalIdx = 0;
auto pLocal = static_cast<Player*>(g_csgo.m_entlist->GetClientEntity(g_csgo.m_engine->GetLocalPlayer()));
if (!pLocal) {
originalIdx = 0;
return;
}
constexpr auto getModel = [](int team) constexpr -> const char* {
constexpr std::array models{
XOR("models/player/custom_player/legacy/ctm_fbi_variantb.mdl"),
XOR("models/player/custom_player/legacy/ctm_fbi_variantf.mdl"),
XOR("models/player/custom_player/legacy/ctm_fbi_variantg.mdl"),
XOR("models/player/custom_player/legacy/ctm_fbi_varianth.mdl"),
XOR("models/player/custom_player/legacy/ctm_sas_variantf.mdl"),
XOR("models/player/custom_player/legacy/ctm_st6_variante.mdl"),
XOR("models/player/custom_player/legacy/ctm_st6_variantg.mdl"),
XOR("models/player/custom_player/legacy/ctm_st6_varianti.mdl"),
XOR("models/player/custom_player/legacy/ctm_st6_variantk.mdl"),
XOR("models/player/custom_player/legacy/ctm_st6_variantm.mdl"),
XOR("models/player/custom_player/legacy/tm_balkan_variantf.mdl"),
XOR("models/player/custom_player/legacy/tm_balkan_variantg.mdl"),
XOR("models/player/custom_player/legacy/tm_balkan_varianth.mdl"),
XOR("models/player/custom_player/legacy/tm_balkan_varianti.mdl"),
XOR("models/player/custom_player/legacy/tm_balkan_variantj.mdl"),
XOR("models/player/custom_player/legacy/tm_leet_variantf.mdl"),
XOR("models/player/custom_player/legacy/tm_leet_variantg.mdl"),
XOR("models/player/custom_player/legacy/tm_leet_varianth.mdl"),
XOR("models/player/custom_player/legacy/tm_leet_varianti.mdl"),
XOR("models/player/custom_player/legacy/tm_phoenix_variantf.mdl"),
XOR("models/player/custom_player/legacy/tm_phoenix_variantg.mdl"),
XOR("models/player/custom_player/legacy/tm_phoenix_varianth.mdl")
};
switch (team) {
case 2: return static_cast<std::size_t>(g_menu.main.misc.model_t.get()) < models.size() ? models[g_menu.main.misc.model_t.get()] : nullptr;
case 3: return static_cast<std::size_t>(g_menu.main.misc.model_t.get()) < models.size() ? models[g_menu.main.misc.model_ct.get()] : nullptr;
default: return nullptr;
}
};
if (const auto model = getModel(pLocal->m_iTeamNum())) {
if (stage == Stage_t::FRAME_RENDER_START)
originalIdx = pLocal->m_nModelIndex();
const auto idx = stage == Stage_t::FRAME_RENDER_END && originalIdx ? originalIdx : g_csgo.m_model_info->GetModelIndex(model);
pLocal->SetModelIndex(idx);
if (const auto ragdoll = static_cast<Player*>(g_csgo.m_entlist->GetClientEntityFromHandle(pLocal->m_hRagdoll())))
ragdoll->SetModelIndex(idx);
}
}
Код:
__forceinline void SetModelIndex(int index) {
return util::get_method< void(__thiscall *)(void *, int) >(this, 75)(this, index);
__forceinline int &m_hRagdoll() {
return get< int >(g_entoffsets.m_hRagdoll);
}
XoredNetvar< GET_XOR_KEYUI32, __COUNTER__ > m_hRagdoll;
INIT_XOREDNETVAR( m_hRagdoll, HASH( "DT_CSPlayer"), HASH("m_hRagdoll"));
}
Код:
model_t.setup("", XOR("model_t"),
{
XOR("ava"),
XOR("markus"),
XOR("michael"),
XOR("michael"),
XOR("squadron"),
XOR("team 6 soldier"),
XOR("buckshot"),
XOR("ricksaw"),
XOR("third commando"),
XOR("mc coy"),
XOR("dragomir"),
XOR("rezan"),
XOR("doctor romanov"),
XOR("maximus"),
XOR("blackwolf"),
XOR("muhlik"),
XOR("rebel"),
XOR("osiris"),
XOR("shahmat"),
XOR("enforcer"),
XOR("slingshot"),
XOR("maximus"),
}, false);
RegisterElement(&model_t, 1);
Upd: не спиздил, а адаптировал ragdoll модель у pMovement
Последнее редактирование: