I was writing this while you found the other post, I'm going to post it anyway
Code:
public checkName() {
new players[32], name[32], tagName[16];
new i, playerCount, player;
tagName = "[TAG]";
get_players(players, playerCount, "ch"); // c is skip bots, h is skip hltv
// Loop through all the players.
for(i = 0; i < playerCount; i++) {
player = players[i];
get_user_name(player, name, 31);
// Check to see if their name contains the tag.
if(containi(name, tagName) == -1) {
// Run a command on the client to set their name to "[TAG] TheirName"
// Then notify them that their name has been changed to contain the tag.
client_cmd(player, "name ^"%s %s^"", tagName, name);
client_print(player, print_chat, "Your name has been changed to use the clan tag.");
}
}
return PLUGIN_CONTINUE;
}
It should work