owness developer
-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
пофикшено пропадание рук
пофикшено ломание десинк чамсов
переменную m_need_update можете удалить, делал ее для дебага одного прикола, который ловил после нажатию кнопки full update в меню
пофикшено ломание десинк чамсов
переменную m_need_update можете удалить, делал ее для дебага одного прикола, который ловил после нажатию кнопки full update в меню
C++:
void CVisuals::agent_changer(ClientFrameStage_t stage) {
static int originalIdx = 0;
bool m_need_update = false;
auto pLocal = static_cast <IBasePlayer*> (interfaces.ent_list->GetClientEntity(interfaces.engine->GetLocalPlayer()));
if (!pLocal) {
originalIdx = 0;
return;
}
constexpr auto getModel = [](int team) constexpr ->
const char* {
constexpr std::array models{
"models/player/custom_player/legacy/ctm_fbi_variantb.mdl",
"models/player/custom_player/legacy/ctm_fbi_variantf.mdl",
"models/player/custom_player/legacy/ctm_fbi_variantg.mdl",
"models/player/custom_player/legacy/ctm_fbi_varianth.mdl",
"models/player/custom_player/legacy/ctm_st6_variante.mdl",
"models/player/custom_player/legacy/ctm_st6_variantg.mdl",
"models/player/custom_player/legacy/ctm_st6_varianti.mdl",
"models/player/custom_player/legacy/ctm_st6_variantk.mdl",
"models/player/custom_player/legacy/ctm_st6_variantm.mdl",
"models/player/custom_player/legacy/ctm_sas_variantf.mdl",
"models/player/custom_player/legacy/tm_leet_variantf.mdl",
"models/player/custom_player/legacy/tm_leet_varianti.mdl",
"models/player/custom_player/legacy/tm_leet_varianth.mdl",
"models/player/custom_player/legacy/tm_leet_variantg.mdl",
"models/player/custom_player/legacy/tm_balkan_variantf.mdl",
"models/player/custom_player/legacy/tm_balkan_variantg.mdl",
"models/player/custom_player/legacy/tm_balkan_varianth.mdl",
"models/player/custom_player/legacy/tm_balkan_varianti.mdl",
"models/player/custom_player/legacy/tm_balkan_variantj.mdl",
"models/player/custom_player/legacy/tm_phoenix_variantf.mdl",
"models/player/custom_player/legacy/tm_phoenix_variantg.mdl",
"models/player/custom_player/legacy/tm_phoenix_varianth.mdl",
"models/player/custom_player/legacy/ctm_heavy.mdl",
};
switch (team) {
case 2:
return static_cast <std::size_t> (vars.misc.agents_t - 1) < models.size() ? models[vars.misc.agents_t - 1] : nullptr;
case 3:
return static_cast <std::size_t> (vars.misc.agents_ct - 1) < models.size() ? models[vars.misc.agents_ct - 1] : nullptr;
default:
return nullptr;
}
};
if (const auto model = getModel(pLocal->GetTeam())) {
if (stage == ClientFrameStage_t::FRAME_RENDER_START)
originalIdx = pLocal->m_nModelIndex();
const auto idx = stage == ClientFrameStage_t::FRAME_RENDER_END && originalIdx ? originalIdx : interfaces.models.model_info->GetModelIndex(model);
pLocal->SetModelIndex(idx);
m_need_update = true;
if (interfaces.engine->IsInGame() && interfaces.engine->IsConnected())
{
interfaces.engine->ExecuteClientCmd("cl_fullupdate"); // call models update
}
m_need_update = false;
if (const auto ragdoll = interfaces.ent_list->GetClientEntityFromHandle(csgo->local->ragdoll()))
ragdoll->SetModelIndex(idx);
m_need_update = true;
if (interfaces.engine->IsInGame() && interfaces.engine->IsConnected())
{
interfaces.engine->ExecuteClientCmd("cl_fullupdate"); // call models update
}
m_need_update = false;
}
}