Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const char* sPlayerModelFiles[] =
- {
- "models/player.mdl",
- "models/player/leet/leet.mdl",
- "models/player/gign/gign.mdl",
- "models/player/vip/vip.mdl",
- "models/player/gsg9/gsg9.mdl",
- "models/player/guerilla/guerilla.mdl",
- "models/player/arctic/arctic.mdl",
- "models/player/sas/sas.mdl",
- "models/player/terror/terror.mdl",
- "models/player/urban/urban.mdl",
- "models/player/spetsnaz/spetsnaz.mdl", // CZ
- "models/player/militia/militia.mdl" // CZ
- };
- enum ModelType_e
- {
- CS_DEFAULT,
- CS_LEET,
- CS_GIGN,
- CS_VIP,
- CS_GSG9,
- CS_GUERILLA,
- CS_ARCTIC,
- CS_SAS,
- CS_TERROR,
- CS_URBAN,
- CS_SPETSNAZ,
- CS_MILITIA,
- };
- bool IsValidCTModelIndex(int modelType)
- {
- switch (static_cast<ModelType_e>(modelType))
- {
- case CS_GIGN:
- case CS_GSG9:
- case CS_SAS:
- case CS_URBAN:
- case CS_SPETSNAZ:
- return true;
- default:
- break;
- }
- return false;
- }
- bool IsValidTModelIndex(int modelType)
- {
- switch (static_cast<ModelType_e>(modelType))
- {
- case CS_LEET:
- case CS_GUERILLA:
- case CS_ARCTIC:
- case CS_TERROR:
- case CS_MILITIA:
- return true;
- default:
- break;
- }
- return false;
- }
- static cvar_t* cl_minmodels = g_Engine.pfnGetCvarPointer("cl_minmodels");
- static cvar_t* cl_min_t = g_Engine.pfnGetCvarPointer("cl_min_t");
- static cvar_t* cl_min_ct = g_Engine.pfnGetCvarPointer("cl_min_ct");
- model_t* m_pRenderModel;
- if (cl_minmodels && cl_minmodels->value)
- {
- if (g_Player[ent->index].iTeam == 1)
- {
- int modelindex = (cl_min_t && IsValidTModelIndex(cl_min_t->value)) ? cl_min_t->value : CS_LEET;
- m_pRenderModel = g_Engine.CL_LoadModel(sPlayerModelFiles[modelindex], nullptr);
- }
- else if (g_Player[ent->index].iTeam == 2)
- {
- if (g_Player[ent->index].bVip)
- {
- m_pRenderModel = g_Engine.CL_LoadModel(sPlayerModelFiles[CS_VIP], nullptr);
- }
- else
- {
- int modelindex = (cl_min_ct && IsValidCTModelIndex(cl_min_ct->value)) ? cl_min_ct->value : CS_GIGN;
- m_pRenderModel = g_Engine.CL_LoadModel(sPlayerModelFiles[modelindex], nullptr);
- }
- }
- }
- else
- m_pRenderModel = g_Studio.SetupPlayerModel(ent->index - 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement