here is a solution I found, or I should say it's a simplified version of sm_skinchooser for CSS only:
add this code to your plugin:
PHP Code:
#define MAX_FILE_LEN 256
#define MAX_MODELS 48
new g_ModelsPlayer_Count;
new String:g_ModelsPlayer[MAX_MODELS][MAX_FILE_LEN];
public OnMapStart()
{
g_ModelsPlayer_Count = LoadModels(g_ModelsPlayer, "configs/skin_downloads.ini");
}
stock bool:SetModelIndex(client, index)
{
if (g_ModelsPlayer_Count && index >= 0 && index < g_ModelsPlayer_Count)
{
SetEntityModel(client, g_ModelsPlayer[index]);
return true;
}
return false;
}
stock LoadModels(String:models[][], String:ini_file[])
{
decl String:buffer[MAX_FILE_LEN];
decl String:file[MAX_FILE_LEN];
new models_count;
BuildPath(Path_SM, file, MAX_FILE_LEN, ini_file);
//open precache file and add everything to download table
new Handle:fileh = OpenFile(file, "r");
if (fileh)
{
while (ReadFileLine(fileh, buffer, MAX_FILE_LEN))
{
// Strip leading and trailing whitespace
TrimString(buffer);
// Skip non existing files (and Comments)
if (FileExists(buffer , true))
{
// Tell Clients to download files
AddFileToDownloadsTable(buffer);
// Tell Clients to cache model
if (StrEqual(buffer[strlen(buffer)-4], ".mdl", false) && (models_count < MODELS_PER_TEAM))
{
strcopy(models[models_count++], strlen(buffer)+1, buffer);
PrecacheModel(buffer, true);
}
}
}
CloseHandle(fileh);
}
else
{
PrintToServer("LoadModels: File not found '%s'", file);
}
return models_count;
}
then
1. create a file named 'skin_downloads.ini' in 'css_server\cstrike\addons\sourcemod\configs' folder
2. now you can add your skins paths to .ini file
example:
PHP Code:
models/player/stenli/Lilith.phy
models/player/stenli/Lilith.sw.vtx
models/player/stenli/lilith.vvd
models/player/stenli/Lilith.dx80.vtx
models/player/stenli/Lilith.dx90.vtx
models/player/stenli/lilith.mdl
materials/models/player/stenli/Lilith/lilith_head_n.vtf
materials/models/player/stenli/Lilith/lilith_body.vmt
materials/models/player/stenli/Lilith/lilith_body.vtf
materials/models/player/stenli/Lilith/lilith_body_2.vmt
materials/models/player/stenli/Lilith/lilith_body_n.vtf
materials/models/player/stenli/Lilith/lilith_head.vmt
materials/models/player/stenli/Lilith/lilith_head.vtf
materials/models/player/stenli/Lilith/lilith_head_2.vmt
and here is the model file I downloaded and used:
http://gamebanana.com/skins/127743
__________________