--- title: "Blocking Bad Nicknames and Ads in Player Names" excerpt: "Stop clan-tag ads, empty names and slurs in player nicks: how CS 1.6 handles name changes, what the engine can filter, and an AMXX name-filter approach that renames offenders." category: "administration" tags: "names, moderation" image: "" read_time: "8 min read" ---

Player names are the one piece of text every visitor controls, and on a public server a fraction of them will abuse it: a website advert as a clan tag, a slur, a name that impersonates an admin, or an empty/blank nick that breaks kill feeds. The engine gives you almost nothing here, so name moderation is an AMX Mod X job. This covers what the engine does at connect, what a name filter can enforce, and how to apply it without breaking legitimate name changes.

1. Understand when a name is set

A client's name is the name setinfo value. It is sent at connect and can be changed at any time in-game via the console (name "whatever") or the options menu. That means a filter cannot be a one-time check at join — a player can connect with a clean name and switch to www.rival-server.com ten seconds later. Any real solution has to react to name changes, not just connects.

2. What the engine and mp_ cvars can do (not much)

Stock CS has no name blacklist. The engine will reject a name that is entirely empty by substituting a default, and it collapses some characters, but there is no cvar to ban a word or a URL from a nick. Do not go looking for an mp_ cvar for this — it does not exist. This is squarely a plugin problem, which is why every serious public server runs a name filter.

3. How an AMXX name filter works

A name-filter plugin hooks the moment a name is set and validates it, using the client_infochanged forward (fired whenever any setinfo, including name, changes) and the namecheck/SetClientKeyValue mechanics to inspect and, if needed, overwrite the new name. The logic is:

  1. Read the proposed new name from the client's info buffer.
  2. Compare it against a blacklist (substrings, or a regex for URLs) and against structural rules (min length, no all-whitespace, character set).
  3. If it violates a rule, reject it — either revert to the previous name or force a neutral placeholder like Player, and optionally warn the client.

Blocking a URL pattern such as .com, .net, www. and http catches the overwhelming majority of name adverts. A short slur list handles the rest. Our CSB Name Filter implements exactly this — a configurable blacklist plus URL and empty-name rules that rename offenders on the spot.

4. Set sensible rules

Filters that are too aggressive punish normal players. Reasonable defaults:

Log every rename so you can tune the list and catch a rule that fires too often.

5. Handle the rename gracefully

When you reject a name, tell the player why and give them a clean fallback rather than silently reverting in a loop — a client whose name is rejected can get stuck re-sending it. Print a one-line chat message (\"Names with website addresses are not allowed\") and set them to a neutral placeholder. Pair the filter with an adverts plugin that states the naming rule occasionally, so it feels like a policy rather than a random kick.

Common errors

Verification

Test each rule from a client console. Try to set a forbidden name and confirm the plugin corrects it:

name "www.some-ad.com"    // should be rejected / renamed
name ""                    // should become a placeholder
name "x"                   // should fail the minimum-length rule

Watch the server console or AMXX log for the rename entries. Then set a perfectly normal name and confirm it is accepted unchanged — a filter that blocks ads but also blocks Steve is worse than no filter. Once it behaves, add the naming rule to your MOTD so players know before they are corrected.