Added support for model with multiple skins (model_skin_index class attribute). Compiles, but not tested.

This commit is contained in:
Richard Helgeby
2013-04-25 09:50:08 +02:00
parent 7e72ede0ca
commit 28e54c36a7
8 changed files with 133 additions and 24 deletions

View File

@ -88,6 +88,7 @@ bool:ClassApplyModel(client, classindex, cachetype = ZR_CLASS_CACHE_PLAYER)
new ModelTeam:team;
new access;
new model;
new skinIndex = 0;
// Get correct index according to cache type.
if (cachetype == ZR_CLASS_CACHE_PLAYER)
@ -102,6 +103,9 @@ bool:ClassApplyModel(client, classindex, cachetype = ZR_CLASS_CACHE_PLAYER)
// Get the model path from the specified cache.
ClassGetModelPath(index, modelpath, sizeof(modelpath), cachetype);
// Get model skin index.
skinIndex = ClassGetModelSkinIndex(index, cachetype);
// Get model team setting from the specified cache.
team = ModelsTeamIdToTeam(ClassGetTeamID(index, cachetype));
@ -185,6 +189,8 @@ bool:ClassApplyModel(client, classindex, cachetype = ZR_CLASS_CACHE_PLAYER)
}
SetEntityModel(client, modelpath);
SetEntProp(client, Prop_Send, "m_nSkin", skinIndex);
return true;
}