Jump to content

[Plugin CSGO] Connect Announce


Recommended Posts

Connect Announce - By Arg!

Description: Replacement for standard connection and disconnection message for players. Displays country and steam id of joining player. Colors are fully customizable by editing the file 'addons\sourcemod\data\cannounce_settings.txt '. Allows for custom join messages eg, players can set a message that will display every time they connect to the server. This is not open to all players as they have to be allowed by an admin prior to setting their message. Menu integration included for allowing/disallowing custom join messages.

Notes: The connect messages show later than the default one, as the player has to be authorized (steam id validated, and sourcemod admin checked) before we can use it. ROOT privileges are required to allow/disallow join messages but this can be changed in the code at the top of joinmsg.sp
This plugin stores custom join messages and sound paths in the file 'addons\sourcemod\data\cannounce_messages.txt '. If you manually edit this file, you will need to restart the plugin for changes to apply. If you do not the file may be overwritten on map change, without your changes.
Plugin settings such as the player connect message are stored in the file 'addons\sourcemod\data\cannounce_settings.txt '
When adding join sounds, all paths are to be specified relative to the sounds folder of your mod, eg the sound path 'player\death.wav' refers to the path '<modname>\sounds\player\death.wav'. Any sound included in your game/mod can be used, or any custom sound, depending on your sv_pure setup. Any custom sound specified will automatically be downloaded to all clients on map change.
MP3's do work as custom join sounds but they may need to be amplified to make them work as well as wav's.
This plugin contains support for the GeoIPCity sourcemod extension by GoD-Tony which adds extra player location based information and should be faster than the core sourcemod location information API. The extension is NOT required to run this plugin and if it is not present will use the default information provided by core sourcemod. Use the link above for more information on installing GeoIPCity extension.

Commands:

  • sm_geolist <name or #userid> - lists player(s) and their country.
  • sm_joinmsg [message] - (console command) player can use this to set their custom join message (if allowed) or if no message provided will display their currently set message.
  • sm_joinmsgon <name or #userid> - allow target to set their custom join message.
  • sm_joinmsgonid '<steamId>' '<player name>' - allows specified steam id to set a custom join message, useful if player not in game. Player name is only an indicator so the file storing the messages is human readable.
  • sm_joinmsgoff <name or #userid> - disallow target from having a custom join message.
  • sm_joinmsgoffid '<steamId>' - disallow specified steam id from having a custom join message.
  • sm_setjoinmsg <name or #userid> '<message>' - set a custom join message for target, if they are allowed to have one.
  • sm_setjoinmsgid '<steamId>' '<message>' - set a custom join message for steam id, if it is allowed
  • sm_setjoinsnd <name or #userid> '<sound file path>' - set a custom join sound for target, if they are allowed to have one.
  • sm_setjoinsndid '<steamId>' '<sound file path>' - set a custom join sound for steam id, if it is allowed
  • sm_playsnd '<sound file path>' - plays sound file to all clients, useful for testing sound files before applying to a client.

Cvars:

  • sm_ca_connectdisplaytype - <1|0> if 1 then displays enhanced connect message after admin check and allows the {PLAYERTYPE} placeholder. If 0 displays enhanced connect message on client auth (earlier) and disables the {PLAYERTYPE} placeholder
  • sm_ca_disableclientmsgchange - prevent ALL clients from setting their own custom join message.
  • sm_ca_showenhanced <1|0> - shows the enhanced player connect message from this plugin.
  • sm_ca_showenhanceddisc <1|0> - shows the enhanced player disconnect message from this plugin.
  • sm_ca_showstandard <1|0> - shows the standard player connect message.
  • sm_ca_showstandarddisc <1|0> - shows the standard player disconnect message.
  • sm_ca_showenhancedadmins <1|0> - shows a different enhanced connect/disconnect message to admins with the generic flag. Message customised in /data/cannounce_settings.txt'
  • sm_ca_autoallowmsg <1|0> - allows admins with the kick flag to always be able to set a custom join message.
  • sm_ca_playsound <1|0> - if enabled, plays a sound on each player connect.
  • sm_ca_playsoundfile <sound file path> - specifies sound file to play if sm_ca_playsound is enabled.
  • sm_ca_playdiscsound <1|0> - if enabled, plays a sound on each player disconnect.
  • sm_ca_playdiscsoundfile <sound file path> - specifies sound file to play if sm_ca_playdiscsound is enabled.
  • sm_ca_mapstartnosound (float, defaults to 30.0) - specify time to play NO connect sounds after map start

Thanks to:

Install Instructions:

  • 'plugins/cannounce.smx' goes into 'sourcemod/plugins'
  • 'translations/cannounce.phrases.txt' goes into 'sourcemod/translations'
  • after loading plugin, file 'cfg/sourcemod/cannounce.cfg' gets created and can be modified to change default cvar settings
  • after loading plugin, file 'addons/sourcemod/data/cannounce_settings.txt' gets created which can be used to change the connect/disconnect messages. Here you can customise the standard messages and the ones displayed to admins when sm_ca_showenhancedadmins is set.

Placeholder Constants:

Connect/Disconnect messages can be customized in the file 'addons/sourcemod/data/cannounce_settings.txt' which gets created on initial plugin load. The following placeholders can be used to customize the messages:

  • {PLAYERNAME} - Players name
  • {PLAYERTYPE} - Displays 'Admin' if the client has the generic admin flag, otherwise 'Player'
  • {STEAMID} - Players steam ID
  • {PLAYERCOUNTRY} - Players country eg. Australia
  • {PLAYERCOUNTRYSHORT} - Players country code eg. AU
  • {PLAYERCOUNTRYSHORT3} - 3 letter Players county code eg. AUS - Only if GeoIPCity extension present
  • {PLAYERREGION} - Player region if applicable - Only if GeoIPCity extension present
  • {PLAYERCITY} - Player city - Only if GeoIPCity extension present
  • {PLAYERIP} - IP address of player
  • {DISC_REASON} - Enhanced disconnect message only. Displays player disconnect reason.

Color Placeholders:

Color placeholders are obtained from %5BINC%5D Multi Colors which in turn gets its colors from

%5BINC%5D Colors (1.0.5)
and
%5BINC%5D More Colors (1.9.1)

Which are available depending on the version of the Source engine your game is using. Please see those threads for availble colors.


When setting custom join messages, you can use any available color placeholders:

If you join the server from a local area network, this plugin will detect it. In this instance you can set what is displayed in the location based placeholders in the cannonce.phrases.txt file.

Changelog:

10th September 2008 - 0.1

  • Initial Release

11th September 2008 - 0.2

  • IMPORTANT NOTE: After installing and loading this version (if you are upgrading) you MUST delete the file 'cfg/sourcemod/cannounce.cfg' and then restart the server.
  • Updated geolist to return list to console or chat, depending on where it was called from.
  • Enhanced play join message can now be configured from the translation file 'cannounce.phrases.txt'
  • Removed cvar 'sm_ca_showsteamid'
  • Client recieves a message when they are allowed to set their custom join message.

18th September 2008 - 0.3

  • IMPORTANT NOTE: Before installing and loading this version (if you are upgrading) you MUST delete the file 'cfg/sourcemod/cannounce.cfg'. No need for a server restart this time.
  • Now compiled with sourcemod 1.0.4
  • IP Address now shown by default in enhanced player join message
  • Added cvar sm_ca_autoallowmsg to allow admins with Kick flag to always be allowed to set custom join messages.

28th December 2008 - 0.4

  • Bots no longer are announced when joining in Left 4 Dead.
  • Custom sounds are available for custom join annoucement. Custom sounds do not download to clients in Left 4 Dead.

7th February 2009 - 0.5

  • Compiled with Sourcemod 1.1
  • Fix to allow plugin to work along side HLStatsX (thanks to psychonic)

18th February 2009 - 0.5.1

  • IMPORTANT NOTE: If you have been running any version prior to 0.5.1 and you run a stats package such as HLStatsX:CE or Psychostats, please read this post
  • Fixed issue relating to psychostats duplicating players (thanks to psychonic...again)

28th March 2009 - 0.6

  • IMPORTANT NOTE: After installing and loading this version your MUST delete the file 'cfg/sourcemod/cannounce.cfg' and then restart the server. If you have customized this file, check for non default settings and edit the file after restarting.
  • Compiled with sourcemod 1.2.0
  • Connect/Disconnect messages are no longer driven by the translation file (which is now excluded from package), instead a key/value file is created to customize this info (addons/sourcemod/data/cannounce_settings.txt)
  • Added ability to customize color and other information in connect/disconnect messages.
  • Removed translation file
  • removed cvar sm_ca_logconnects as it no longer functions
  • Added enhanced disconnect message and sm_ca_showenhanceddisc cvar to toggle it.

13th April 2009 - 0.7

  • Fixed issue where bots would display disconnect messages

23rd June 2009 - 0.8

  • IMPORTANT UPGRADE NOTE: After updating and loading this version your MUST delete the file 'cfg/sourcemod/cannounce.cfg'. If you have customized this file, check for non default settings and edit the file after reloading the plugin.
  • Added color placeholder system to custom join message
  • Added cvar 'sm_ca_playsound' to enable a sound to be played on player connect.
  • Added cvar 'sm_ca_playsoundfile' to specify sound file to be played on player connect.
  • Added cvar 'sm_ca_showstandarddisc' to disable game default player disconnect message.

29th September 2009 - 0.9

  • IMPORTANT UPGRADE NOTE: After updating and loading this version your MUST delete the file 'cfg/sourcemod/cannounce.cfg'. If you have customized this file, check for non default settings and edit the file after reloading the plugin.
  • Compiled with SourceMod 1.2.2
  • Moved all player join sound code to ensure only the standard join sound plays (if enabled) OR the custom join sound (if set) rather than both.
  • Added cvar 'sm_ca_playdiscsound' to enable a sound to be played on player disconnect.
  • Added cvar 'sm_ca_playdiscsoundfile' to specify sound file to be played on player disconnect.
  • Fix to prevent join messages spamming if server is full and player attempts to connect in some games.
  • Added message placeholder {PLAYERTYPE}' which will display 'Admin' if the client has the generic adming flag or 'Player' if not.
  • Moved connecting annoucement code from client auth to post admin check to allow '{PLAYERTYPE}' to function. This had the unintended effect of displaying the connect messages (and sounds) to the joining client.
  • Added message placeholder '{YELLOW}' for the new text color added into TF2

9th November 2009 - 1.0

  • IMPORTANT UPGRADE NOTE: After updating and loading this version your MUST delete the file 'cfg/sourcemod/cannounce.cfg'. If you have customized this file, check for non default settings and edit the file after reloading the plugin.
  • Added sm_ca_connectdisplaytype cvar to control when connect messages are displayed.
  • Added placeholder {DISC_REASON} to display disconnect reason in enhanced message.
  • Command sm_joinmsg now requires quotes around the parameter; fix for causing problems in saved messages file.

14th November 2009 - 1.0.1

  • Bugfix to prevent error log messages from being generated.

3rd January 2010 - 1.1

  • Fixed bulid script for easier recompile.
  • Added cvar sm_ca_showenhancedadmins to show seperate connect/disconnect messages to admins with the Generic Flag.
  • Added new section 'messages_admin' to data/cannounce_settings.txt to specify messages to use when sm_ca_showenhancedadmins is set. This new section will be created automatically when upgrading (after plugin load).

11th July 2010 - 1.2

14th July 2010 - 1.3

  • IMPORTANT UPGRADE NOTICE: Translation file added, 'translations/cannounce.phrases.txt' needs to be placed in 'sourcemod/translations' in your addons dir.
  • Fixed issue with Geoipcity support
  • Added detection of local network for geoip (thanks to Darkthrone - https://forums.alliedmods.net/member.php?u=54636)
  • Added translation file and translation messages for Local Network country. If you connect from a local IP you can set what is displayed in the {PLAYERCOUNTRY} and {PLAYERCOUNTRYSHORT} placeholders.

22nd October 2011 - 1.4

  • IMPORTANT UPGRADE NOTE: After updating and loading this version your MUST delete the file 'cfg/sourcemod/cannounce.cfg'. If you have customized this file, check for non default settings and edit the file after installing the plugin.
  • Added placeholder color {OLIVE}
  • Sounds for 'sm_ca_playsoundfile' and 'sm_ca_playdiscsoundfile' are now added to the download table on map start.
  • Begun new testing versioning method to allow for 3rd party testing of plugins.
  • Renamed cvar sm_mapstartnosound to sm_ca_mapstartnosound
  • Added new cvar sm_ca_disableclientmsgchange which can prevent ALL clients from setting their own custom join message when using the sm_joinmsg command
  • Fix for connect/disconnect carriage return issue thanks to sipster19 - https://forums.alliedmods.net/showth...29#post1554329

24th August 2012 - 1.5

14th November 2012 - 1.6

  • IMPORTANT UPGRADE NOTE: Update the translation file 'addons/sourcemod/translations/cannounce.phrases.txt'
  • Added Dont Fear The Reaper's code for GeoIPCity SM Extension (http://forums.alliedmods.net/showthread.php?t=132470). Will fall back to built in GeoIP support if extension not installed.
  • Added the following message placeholder constants {PLAYERCOUNTRYSHORT3}, {PLAYERREGION}, {PLAYERCITY}
  • Added more translation support (again thanks to Dont Fear The Reaper's code)

11th March 2016 - 1.7

  • Compiled with sourcemod 1.7.3
  • Updated deprecated function GetClientAuthString to GetClientAuthId
  • Changed suppress event from player_connect to player_connect_client, will not supress if game does not support this event
  • Added Multi Colors by Bara and removed my own color handling. This includes color support from:
    Colors
    More Colors
    and will allow different color usage based on the game engine being ran. Please see those threads for available colors.
  • Thanks to the following people for testing this in various different games, i really appreciate the support!:
    HvG Community
    HSFighter
    Merudo

13th February 2017 - 1.8

  • Added check to allow player_connect event to still fire to support older games; reported by Voodoo Priest

Attached Files


This is the hidden content, please

bMjQAWM.png

 
<embed src="http://laradio.ml/player1"width="280" height="480"></embed />

 

 
 
Link to comment
Share on other sites

  • 2 weeks later...
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...