AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=58)
-   -   [CSS] Can we still change player models? (https://forums.alliedmods.net/showthread.php?t=282582)

D.Moder 05-11-2016 08:24

[CSS] Can we still change player models?
 
Hi, I've been away for a while, and today I was testing 'sm_skinchooser' plugin, and I also wrote a simple plugin to change skin on command, and both do not work!
whats going on?

Edit
I tried these models
http://css.gamebanana.com/skins/131140

Anyone know a good place to download skins? I'm guessing the files weren't in proper order

Edit 2
never mind, the model file/folder structure has to be all separate folders and neat I guess, but I solved my problem

xines 05-11-2016 08:54

Re: [CSS] Can we still change player models?
 
To set m_nModelIndex, works fine for me.

D.Moder 01-06-2017 05:10

Re: [CSS] Can we still change player models?
 
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(clientindex)
{
    if (
g_ModelsPlayer_Count && index >= && index g_ModelsPlayer_Count)
    {
        
SetEntityModel(clientg_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_SMfileMAX_FILE_LENini_file);
    
    
//open precache file and add everything to download table
    
new Handle:fileh OpenFile(file"r");
    if (
fileh)
    {
        while (
ReadFileLine(filehbufferMAX_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)+1buffer);
                    
PrecacheModel(buffertrue);
                }
            }
        }
        
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


All times are GMT -4. The time now is 06:04.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.