Description
This plugins allows server owners to create as many setups as desired for custom connect/disconnect messages. Each setup has customizable chat colors, tags, tag colors, and access flags required to activate the messages. Setups can also be STEAM ID specific to apply just to a single player (just use the STEAM ID as the setup title and place above any setups for groups). Additionally, setups can define a group or player to skip connect and/or disconnect messages for.
I also included a feature that will disable it for a configurable time on map start, then enable it for connecting players afterwards the set time. This feature is off by default, but is included in case someone wanted to have a setup that applies to all players, but does not want the message spam on map starts.
Notes:
The plugin uses the first applicable tag found, so order them accordingly.
If the flag line is left out of a setup, or if the flag is set to "public", it is available to all players.
If the flag line is included, but left blank (i.e. ""), it will apply to players with ANY admin flags (including reserve slot or custom flags).
The flag line can use combinations of flags (e.g. "ast" will check for all three flags).
CVars
tcm_delay - Amount of time (in seconds) after map start until connect messages are enabled.
tcm_enabledelay - Enables skipping of connect announcements after map change until the time set by tcm_delay.
tcm_debugmode (debug version of plugin only) - Enable/disable debug output. (0 = Disabled, 1 = Enabled). Note, this produces very large files rather quickly, so only turn this on to debug your setup, then turn it off afterwards.
Sample Setup
Code:
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//Possible Key-Values:
//
// //player's personal connect msg <<<putting two slashes will allow you to leave comments above each setup for organization
// "STEAM_0:0:1234567" <<<this can be named anything. If it matches a players steam ID, it will be available to them only, else, it is just a section name
// {
// "connectmsg" "1" <<<if setup applies to player, it will show after they connect (1 = enable, 0 = disable, default = 0)
// "disconnectmsg" "1" <<<if setup applies to player, it will show after they disconnect (1 = enable, 0 = disable, default = 0)
// "ignoreconnect" "1" <<<if setup applies to player, it will block custom connect messages (1 = enable, 0 = disable, default = 0)
// "ignoredisconnect" "1" <<<if setup applies to player, it will block custom disconnect messages (1 = enable, 0 = disable, default = 0)
// "center" "1" <<<enable/disable announcement in center of screen (1 = enable, 0 = disable, default = 1)
// "chat" "1" <<<enable/disable announcement in chat (1 = enable, 0 = disable, default = 1)
// "message" "{tag} {playername} Connected" <<<message to be displayed. {tag} is replaced with the tag defined below, {playername} is replaced with the player's current name (default = "{tag} {playername} Connected/Disconnected")
// "tag" "=Hacker=" <<<tag to use if {tag} is in the message (more useful for groups, since individual players can just put it as part of the msg) (default = "[TagNotSet]")
// "tagcolor" "FFFF00" <<<hex color code used for tag in chat messages (default = "FFFFFF")
// "chatcolor" "FFFF00" <<<hex color code used for chat messages (default = "FFFFFF")
// }
//
//Note: any missing lines will assume their default values.
//
//////////////////////////////////////////////////////////////////////////////////
//
//Order of Operations:
//
//Players get the first matching setup. That said, this is the suggested order to organize your setups:
//Personal setups -> group 'ignore' setups -> group setups.
//
//For all setups, be sure to make check which setup first applies. e.g. if admins have flags 'b' and 's' and donators have 's',
//make sure the admin setup comes first, else they will get the donator setup.
//
//Admin command to reload setups: sm_reloadtcm ("Reload Connect/Disconnect Setups" is also added in the admin menu under "Server Commands")
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
"Setups"
{
//player1's personal connect msg
"STEAM_0:0:1234567"
{
"connectmsg" "1"
"center" "1"
"chat" "1"
"message" "{tag} {playername} Connected"
"tag" "=Hacker="
"tagcolor" "FFFF00"
"chatcolor" "FFFF00"
}
//player1 wants no announcement of their disconnects
"STEAM_0:0:1234567"
{
"ignoredisconnect" "1"
}
//player2's personal connect msg: Their tag is their name using the color red ("FF0000"). e.g. "(color=Red)Player2 (color=Yellow)is in the house!"
"STEAM_0:0:0987654"
{
"connectmsg" "1"
"center" "1"
"chat" "1"
"message" "{tag} is chillin!"
"tag" "{playername}"
"tagcolor" "FF0000"
"chatcolor" "FFFF00"
}
//player2's personal disconnect msg: No name in message, Red text "The Troll", followed by yellow text "has retreated!"
"STEAM_0:0:0987654"
{
"connectmsg" "1"
"center" "1"
"chat" "1"
"message" "{tag} has retreated!"
"tag" "The Troll"
"tagcolor" "FF0000"
"chatcolor" "FFFF00"
}
//hide admins connecting to the server
"AdminConnect"
{
"ignoreconnect" "1"
"flags" "b"
}
//hide admins disconnecting from the server
"IgnoreAdminDisconnect"
{
"ignoredisconnect" "1"
"flags" "b"
}
//note, flag below is the letter 'o', not the number '0'. Tag color is different than the rest of the message.
"VIPConnect"
{
"connectmsg" "1"
"flags" "o"
"center" "1"
"chat" "1"
"message" "{tag} {playername} joined the server!"
"tag" "[VIP]"
"tagcolor" "FFFF00"
"chatcolor" "00FF00"
}
//tag color line is missing, so it will use the default color "FFFFFF"
"VIPDisconnect"
{
"disconnectmsg" "1"
"flags" "o"
"center" "1"
"chat" "1"
"message" "{tag} {playername} left the server!"
"tag" "[VIP]"
"chatcolor" "00FF00"
}
"Donator"
{
"connectmsg" "1"
"flags" "s"
"center" "1"
"chat" "1"
"message" "{tag} {playername} Connected"
"tag" "[Donator]"
"tagcolor" "FFFF00"
"chatcolor" "FFFF00"
}
//tag can be left out of message, and therefore tag key-value lines ("tag" and "tagcolor") are not required
"Member"
{
"connectmsg" "1"
"flags" "t"
"center" "1"
"chat" "1"
"message" "{playername} Connected"
"chatcolor" "FFFF00"
}
}
Changelog
07/07/14 (v4.0)
Revisiting an old plugin of mine due to it occasionally glitching on the connect msgs....my how my coding has changed a bit and I've learned much more, lol....
Recoded most of plugin to avoid global variables and keep within single functions. This avoids needlessly using resources via global variables and having to create arrays for all players.
Removed admin menu include....not sure why that was in there. Wasnt actually using the regex include to check for valid hex, so i removed that too...
Recoded everything to use sizeof() instead of actual numbers to allow more flexibility.
Added a break to the loops to avoid excess loops (although most of it wouldnt process due to one of the first lines anyways, still, this is better).
04/07/14 (v3.4)
Fixed formatting issue that was limiting length of messages.
Removed admin command to reload and admin menu. Setups reload each time a player connects/disconnects, so it served no purpose.
Introduced debug version of plugin. This version is NOT recommended to run normally (because it can potentially generate large debug logs), but is available to use to test your setups. After getting your setups working how you would like, you should install the non-debug version in its place (no need to replace your cfg files though).
04/07/14 (v3.3)
Minor code edits.
Edited the reload function a bit.
04/02/14 (v3.2)
Moved most variables to arrays. When multiple people connected at the same time, sometimes the global variables would get overwritten halfway through the plugin's output, causing the message to only show part of it or trigger multiple times. Most variables were moved to arrays so that each client has a unique string that wont be overwritten by other players.
Changed sizes of some strings
03/31/14 (v3.1)
Added ability to create setups for ignoring players/groups
Changed default values of some key-value lines in case they are left out
Added ability to use separate colors for tag
03/30/14 (v3.0)
Added ability to specify if setup is for connect and/or disconnect messages
Added ability to use any text desired in messages
Added command in admin menu to reload setups
03/25/14 (v2.1)
- Initial release.
Installation
Install tog_connectmsgs.txt in cstrike/addons/sourcemod/configs/ folder.
For debug version: (should only be used to set up your tog_connectmsgs.txt file, then uninstalled and replaced with normal version)
Install togconnectmsg_v4_0d.smx in cstrike/addons/sourcemod/plugins/ folder. Normal version:
Install togconnectmsg_v4_0.smx in cstrike/addons/sourcemod/plugins/ folder.
Note: This version is no longer being developed, as the plugin has since been completely recoded and was made private. PM me to discuss the current version (CS:GO compatible, add sounds to setups (multiple possible per setup, one randomly selected), Steam ID and User ID replacement, and country replacement with configurable colors).
i dont understand why you just didnt update the other thread, it had no replies on it..
The old version was simpler, and possibly some users might not want all the new features. This one would use more resources, etc.
All in all, the old one certainly could be replaced, but I left in just in case someone wanted it. Also, this one now (I just updated to v3.2) uses arrays for every variable and is more complex. In the end, it just isnt hurting anything to have the old one up in case someone wants it.
Is your plugin compatible with tf2? i want hide admins when join in server
I saw you use morecolors.inc is necessary install this include to run this plugin without problems.?
morecolors.inc is only needed to compile the plugin. As far as if it works for tf2, I'm not sure what events fire in tf2. I cant think of any that would be CSS specific though, so I would think it should. Try it and let us know!
I used the plugin yesterday but when i join in server people know i'm joining
My setup file is this:
"Setups"
{
//hide admins connecting to the server
"AdminConnect"
{
"ignoreconnect" "1"
"flags" "b"
}
//hide admins disconnecting from the server
"IgnoreAdminDisconnect"
{
"ignoredisconnect" "1"
"flags" "b"
}
}
Could you tell me if i'm doing something wrong? Do i need all he flag complete because the flag is more than one letter
//hide admins connecting to the server
"admin steamid"
{
"connectmsg" "0 "
}
//hide admins disconnecting from the server
"admin steamid"
{
"disconnectmsg" "0"
}
What happen if i use this config ?
I'm sure im doing something wrong but i cant detect what is. i need try something if works i update this post
Edit: worked, now i need hide when admin join in one team thank you so much for your help