Quote:
Originally Posted by SpannerSpammer
There's a reason for that: I don't think anyone has ever needed
to or done anything like that before. It's easy to do in C++:
Code:
int GetNumSkins( edict_t *pEntity )
{
void *pmodel = GET_MODEL_PTR( pEntity );
studiohdr_t *pstudiohdr;
pstudiohdr = (studiohdr_t *)pmodel;
if (!pstudiohdr) return 0;
int iRet = pstudiohdr->numskinref;
if( iRet < 0 ) iRet = 0;
return iRet;
}
It's not so easy to do in PAWN. You would have to open the MDL file in binary mode
then fseek to the part of the file that contains the model data (i.e. an offset
value from the beginning of the file since the model data is stored after bone,
animation and sequence data). Then you could either fseek directly to skin data if
you know the offset value OR you could read the entire model studiohdr_t data
structure into an enumerated "struct" and extract the skin info from there.
See this thread for reference:
https://forums.alliedmods.net/showthread.php?t=178658
|
Well, this si required for my tfc server. FM has a menu plugin that for models that if a model has more skins, it shows the skins tab.