TechBuzzPro

Assign Character Models to Players on L4D2 Server

· 5 min read · Apps & Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

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 .cfg files (use Notepad++ or a similar text editor).
  • Optional: SourceMod and MetaMod installed on the server for dynamic assignments.

Step-by-Step

  1. Locate your server's cfg folder. Typically this is at left4dead2/cfg/ in your server directory. If you're using a control panel, look for a "File Manager" or "FTP" option.
  2. Create a new configuration file. Name it something like model_assign.cfg. This will hold your assignment commands.
  3. 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 status in the console) or from the player's profile.
  4. Write the assignment command. The basic command is sm_playermodel <target> <model> (requires SourceMod). Without SourceMod, you can use the built-in ent_fire command, but it's more complex. For this guide, we'll assume SourceMod is installed.
  5. 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
    For custom models, use the full path to the .mdl file in your models folder.
  6. Save the file.
  7. Execute the file on server start. Add exec model_assign.cfg to your server.cfg file (located in cfg/). This ensures assignments apply every time the server starts.
  8. 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.
  9. 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 .mdl extension. For custom models, double-check the file is in the correct folder and the path is correct.
  • Not having SourceMod installed. The sm_playermodel command 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 exec command 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.cfg before 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 .vtx and .vvd file. 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 version in 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.cfg is in server.cfg and that the file name is correct. Also, ensure the file is saved in the cfg folder.
  • 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

  1. Can I assign models without SourceMod? Yes, but it's more complicated. You can use the ent_fire command 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.
  2. 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.
  3. Will the model assignment persist across map changes? Yes, if the commands are in the model_assign.cfg and executed on server start, they will apply to every map. However, if you execute them manually, they will reset on map change.
  4. 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.cfg or a plugin.
  5. 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.
  6. 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.