--- 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.
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.
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.
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:
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.
Filters that are too aggressive punish normal players. Reasonable defaults:
www., http, and common TLDs in a name are almost always ads. This is the single highest-value rule.ADMIN, your server name, or an owner's handle, so nobody masquerades as staff.Log every rename so you can tune the list and catch a rule that fires too often.
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.
client_infochanged. A name changed in-game must be re-validated.ADMIN block by checking their flags before filtering.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.