Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void GetModelIndexPlayer(char* modelname, char* texture, int* array, int index)
- {
- if (!array[index])
- {
- char filename[256];
- sprintf(filename, "models/player/%s/%s.mdl", modelname, modelname);
- model_t* pModel = g_Engine.CL_LoadModel(filename, NULL);
- if (pModel)
- {
- studiohdr_t* pStudioHeader = (studiohdr_t*)g_Studio.Mod_Extradata(pModel);
- mstudiotexture_t* ptexture = (mstudiotexture_t*)((byte*)pStudioHeader + pStudioHeader->textureindex);
- for (int i = 0; i < pStudioHeader->numtextures; i++)
- {
- if (strstr(ptexture[i].name, texture) && strstr(pModel->name, modelname))
- array[index] = ptexture[i].index;
- }
- }
- }
- }
- char* Terror[] =
- {
- "arctic", "guerilla", "leet", "terror",
- };
- char* CounterTerror[] =
- {
- "gign", "gsg9", "sas", "urban",
- };
- char* PlayerModels[] =
- {
- "arctic", "gign", "gsg9", "guerilla", "leet", "sas", "terror", "urban",
- };
- char* PlayerSkin[] =
- {
- "ARTIC_Working1", "GIGN_DMBASE2", "GSG9_Working1", "GUERILLA_DMBASE", "Arab_dmbase1", "SAS_DMBASE1", "Terrorist_Working1", "SEAL_Working1",
- };
- void SetRemapColors(struct cl_entity_s* ent)
- {
- if (ent && ent->player)
- {
- for (int i = 0; i < 8; i++)
- GetModelIndexPlayer(PlayerModels[i], PlayerSkin[i], TexPlayerIndex, i);
- for (int i = 0; i < 4; i++)
- GetModelIndexPlayer(Terror[i], "Backpack1", TexBackpack1Index, i);
- for (int i = 0; i < 4; i++)
- GetModelIndexPlayer(CounterTerror[i], "Backpack2", TexBackpack2Index, i);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement