Assign Character Models to Players on L4D2 Server
In this article
This guide explains how to assign specific character models (e.g., Coach, Ellis, Nick, Rochelle, or custom models) to individual players on a Left 4 Dead 2 dedicated server. This is useful for roleplay servers, custom campaigns, or simply to give players their preferred survivor. You'll need access to your server's files (via FTP or a control panel) and the ability to edit text files. No plugins are required for basic assignments, but SourceMod is recommended for dynamic control.
What You'll Need
- Access to your L4D2 server's files (FTP or file manager in your hosting panel).
- Basic knowledge of editing
.cfgfiles (use Notepad++ or a similar text editor). - Optional: SourceMod and MetaMod installed on the server for dynamic assignments.
Step-by-Step
- Locate your server's
cfgfolder. Typically this is atleft4dead2/cfg/in your server directory. If you're using a control panel, look for a "File Manager" or "FTP" option. - Create a new configuration file. Name it something like
model_assign.cfg. This will hold your assignment commands. - Identify player identifiers. You can use SteamID (STEAM_1:0:123456) or player name. SteamID is more reliable. Find it via the server console (type
statusin the console) or from the player's profile. - Write the assignment command. The basic command is
sm_playermodel <target> <model>(requires SourceMod). Without SourceMod, you can use the built-inent_firecommand, but it's more complex. For this guide, we'll assume SourceMod is installed. - Add commands to the file. For each player, add a line like:
sm_playermodel "STEAM_1:0:123456" "models/survivors/survivor_coach.mdl"
Replace the SteamID and model path. Default survivor models are:
- Coach:
models/survivors/survivor_coach.mdl - Ellis:
models/survivors/survivor_mechanic.mdl - Nick:
models/survivors/survivor_biker.mdl - Rochelle:
models/survivors/survivor_producer.mdl
.mdlfile in yourmodelsfolder. - Coach:
- Save the file.
- Execute the file on server start. Add
exec model_assign.cfgto yourserver.cfgfile (located incfg/). This ensures assignments apply every time the server starts. - For dynamic assignments (optional). If you want to assign models without restarting, use the server console or RCON to execute the commands manually. For example, type
sm_playermodel "STEAM_1:0:123456" "models/survivors/survivor_coach.mdl"in the console. - Test the setup. Join the server with a test account, or ask a player to join, and verify the model changes. You may need to die and respawn or change maps for the model to apply.
Common Mistakes
- Using the wrong target syntax. When using
sm_playermodel, the target must be in quotes. If you use the player's name, it must match exactly (case-sensitive). - Incorrect model path. The path must be relative to the
models/folder and include the.mdlextension. For custom models, double-check the file is in the correct folder and the path is correct. - Not having SourceMod installed. The
sm_playermodelcommand is a SourceMod command. If you don't have SourceMod, the command won't work. You'll need to use a different method (see troubleshooting). - Executing the file too late. If you put the
execcommand in the middle of the server.cfg, it might run before players connect. Place it near the end of the file.
Tips
- Use SteamIDs for reliability. Player names can change, but SteamIDs are permanent.
- Create a backup of your
server.cfgbefore editing. - Test with a dummy account. Use a second Steam account to join and verify the model assignment works before applying to real players.
- For custom models, ensure they are properly installed. Custom models must be in the
models/folder and may require a.vtxand.vvdfile. Also, players may need to download the model files if they don't have them. - Consider using a SourceMod plugin for more control. Plugins like "Playermodel Manager" allow you to assign models via chat commands or menus.
Troubleshooting
- Model doesn't change. First, check if SourceMod is running (type
sm versionin console). If it returns an error, SourceMod isn't installed. If it is, ensure the command syntax is correct and the player is connected. The model may only update after the player dies and respawns or after a map change. - Command not found. This means SourceMod is not installed or the command is not available. Install SourceMod and MetaMod, then restart the server.
- Custom model shows as purple/black checkerboard. This indicates the model file is missing or not properly uploaded. Re-upload the files and ensure the path is correct.
- Assignments don't apply on server start. Check that
exec model_assign.cfgis inserver.cfgand that the file name is correct. Also, ensure the file is saved in thecfgfolder. - Player model resets after death. Some game modes or plugins may reset models. If you're using a respawn plugin, it might override the model. You may need to add a timer or use a plugin that re-applies the model on respawn.
Frequently Asked Questions
- Can I assign models without SourceMod? Yes, but it's more complicated. You can use the
ent_firecommand to set the model on a player's entity, but it requires getting the entity index and works only for the current map. It's not persistent. - Can I assign models to bots? Yes, you can target bots using their name (e.g., "Coach") or entity index. The command is the same, but bots may not have a SteamID.
- Will the model assignment persist across map changes? Yes, if the commands are in the
model_assign.cfgand executed on server start, they will apply to every map. However, if you execute them manually, they will reset on map change. - Can I assign different models for different game modes? Yes, you can create separate config files and execute them based on the game mode using conditional logic in
server.cfgor a plugin. - Do players need to download custom models? Yes, if you use custom models, players must have them installed or they will see a default model. You can set up a FastDL (Fast Download) server to automatically send files to players.
- Can I assign models based on a player's team? Yes, but it requires a plugin. The basic command assigns to a specific player, not a team. Plugins can check team and apply models accordingly.