Author Topic: How set custom model for race  (Read 4930 times)

kvip

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • Krotchy.RU
    • Email
How set custom model for race
« on: June 01, 2014, 06:16:27 PM »
Hi all.
How set model for race w3s?

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2437
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: How set custom model for race
« Reply #1 on: June 01, 2014, 06:27:30 PM »
war3source does not handle models directly, your race needs to manage that

Remy Lebeau

  • Sr. Member
  • ****
  • Posts: 497
    • View Profile
Re: How set custom model for race
« Reply #2 on: June 02, 2014, 05:30:28 PM »
Firstly you need to get custom model files (s-low.net is a good source of them still).

Then you need to upload the model files to the appropriate server/s (depending on whether you run a HS d/l server - which I'd recommend if you're going to use custom models).

Then you need to modify the race you want to have the custom model using code something like the below (of course replacing the paths and filenames):

Code: [Select]
public OnMapStart()
{
    PrecacheModel("models/player/elis/gr/grimreaper.mdl");
    AddFileToDownloadsTable("materials/models/player/elis/gr/gr.vmt");
    AddFileToDownloadsTable("materials/models/player/elis/gr/gr.vtf");
    AddFileToDownloadsTable("materials/models/player/elis/gr/gr_head.vmt");
    AddFileToDownloadsTable("materials/models/player/elis/gr/gr_head.vtf");
    AddFileToDownloadsTable("materials/models/player/elis/gr/gr_head_NORMAL.vtf");
    AddFileToDownloadsTable("materials/models/player/elis/gr/gr_NORMAL.vtf");
    AddFileToDownloadsTable("models/player/elis/gr/grimreaper.dx80.vtx");
    AddFileToDownloadsTable("models/player/elis/gr/grimreaper.dx90.vtx");
    AddFileToDownloadsTable("models/player/elis/gr/grimreaper.mdl");
    AddFileToDownloadsTable("models/player/elis/gr/grimreaper.phy");
    AddFileToDownloadsTable("models/player/elis/gr/grimreaper.sw.vtx");
    AddFileToDownloadsTable("models/player/elis/gr/grimreaper.vvd");

}


public OnWar3EventSpawn( client )
{
    new race = War3_GetRace( client );
    if( race == thisRaceID && ValidPlayer( client, true ))
    {   
        SetEntityModel(client, "models/player/elis/gr/grimreaper.mdl");
        if (GetClientTeam(client) == TEAM_CT)
        {
            W3SetPlayerColor(client,thisRaceID,0,204,255,20,GLOW_SKILL);   
        }
        else
        {
            W3SetPlayerColor(client,thisRaceID,255,51,0,20,GLOW_SKILL);   
        }
    }
}


I'd generally recommend either having two different models for different teams (so people can tell what team you are), or setting the player to glow their team colour (which is what we do with the grimreaper model)