Raised This Month: $51 Target: $400
 12% 

[CSS] Can we still change player models?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
D.Moder
I uploaded 2 great gameplay plugins here
Join Date: Sep 2009
Location: Sin city
Old 05-11-2016 , 08:24   [CSS] Can we still change player models?
Reply With Quote #1

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
__________________
Creator of COD-Life (Half COD, Half Life)
https://forums.alliedmods.net/showthread.php?t=261162
twitter: @D_Moder_61216

Last edited by D.Moder; 05-11-2016 at 15:19. Reason: Need to be deleted, mistake!
D.Moder is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 05-11-2016 , 08:54   Re: [CSS] Can we still change player models?
Reply With Quote #2

To set m_nModelIndex, works fine for me.
__________________
xines is offline
D.Moder
I uploaded 2 great gameplay plugins here
Join Date: Sep 2009
Location: Sin city
Old 01-06-2017 , 05:10   Re: [CSS] Can we still change player models?
Reply With Quote #3

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
__________________
Creator of COD-Life (Half COD, Half Life)
https://forums.alliedmods.net/showthread.php?t=261162
twitter: @D_Moder_61216

Last edited by D.Moder; 01-06-2017 at 05:54. Reason: improved LoadModels
D.Moder is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:14.


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