There's a function for this,
ImplodeStrings.
Store your strings in a two dimensional array, an example of use:
PHP Code:
char names[MAXPLAYERS][MAX_NAME_LENGTH];
int count;
for(int i = 1; i <= MaxClients; i++) {
if(IsClientInGame(i)) {
Format(names[count++], sizeof(names[]), "%N", i);
}
}
char buffer[193]; // Max length of chat messages in CS:S + 1 to account for null terminator.
ImplodeStrings(names, count, ", ", buffer, sizeof(buffer));
PrintToChatAll("Players: %s", buffer);
Output: "Players: klashfire, humbugtheman, Farbror Godis^"
EDIT: Made a mistake.