AlliedModders (
-   GHW_Chronic's Scripts (
-   -   GHW Connect Messages (

GHW_Chronic 11-23-2007 07:06

GHW Connect Messages
7 Attachment(s)
  • This plugin shows connection messages when a player connects/disconnects.

  • Colored Text
  • Customizable
  • Connect/Disconnect Sounds

  • cm_connect_string - String that is displayed when a player connects
    • Default: "[AMXX] %name (%steamid) has connected (%country)."
  • cm_disconnect_string - String that is displayed when a player disconnects
    • Default: "[AMXX] %name (%steamid) has disconnected (%country)."
  • cm_flags - Flags for Customizing (Add the numbers up)
    • 1 - SHOW_COLOR (green)
    • 2 - SHOW_CONNECT
    • Default: 31 (All)
  • cm_connect_sound - Sound file that is played on connect
    • Default: "buttons/bell1.wav" (Half-Life Sound)
  • cm_disconnect_sound - Sound file that is played on disconnect
    • Default: "fvox/blip.wav" (Half-Life Sound)

String Replace Characters:
  • %name - replaced with (dis)connecting player's name
  • %country - replaced with (dis)connecting player's country
  • %steamid - replaced with (dis)connecting player's steamid
  • %ip - replaced with (dis)connecting player's ip

Default Connect Message Appears As:
  • [AMXX] Name (STEAMID) has connected (country).

ConnorMcLeod 11-23-2007 07:33

Re: GHW Connect Messages
Good job, for sure i will use it.

May be make the geoip feature optional (to prevent geoip module from loading)

Wouldn't it be better to get the msgid as a global, and not use players[i] 3 times in your loop ?

new gmsgSayText public plugin_init() {     register_plugin("GHW Connect Messages","1.0","GHW_Chronic")     display_type_pcvar = register_cvar("cm_flags","127")         gmsgSayText = get_user_msgid("SayText") } // ... //             new num, players[32],player             get_players(players,num,"ch")             for(new i=0;i<num;i++)             {                 player = players[i]                 message_begin(MSG_ALL,gmsgSayText,{0,0,0},player)                 write_byte(player)                 write_string(string)                 message_end()                 if(display_type & PLAY_SOUND_CONNECT)                 {                     client_cmd(player,"spk %s",connect_soundfile)                 }             }

credit for v3x ?

GHW_Chronic 11-23-2007 07:39

Re: GHW Connect Messages
A. thx
B. disagree
17. I was going to do that when I finished the code but forgot
Q. Don't have to show me how to do it thx though
K. v3x?

Edit: v3x - didn't take anythin from him. Only thing I see in common w/ his is the base idea rly (which im not sure was his to begin with)

Simon Logic 11-23-2007 07:46

Re: GHW Connect Messages
LOL, i made a template for new plugin which should be as much customizable as my Preset KillStreak plugin but have no time to start to work on it yet. I think you have a chance to make it an ultimate connection announcer plugin which will cover all user needs.

Here is what i was going to implement:
1) let user to set string format per each area where announce msg should appear: in chat, at HUD, at console; don't forget to double them for connect & disconnect events (so, there will be 6 more cvars). Each format has predefined vars which will be replaced by values, i.e.
%n% - player name
%s% - player steam id
%i% - player ip
%c% - country
%r% - player rank

2) you should rearrange config params per each of two events (connect/dicsonnect) by using the following flags:

                        c - announce in Chat
                        h - announce at HUD
                        o - announce within cOnsole
                        s - announce with sound

Hope you'll find time to improve it :D

Darkless 11-23-2007 07:53

Re: GHW Connect Messages
GJ GHW_Chronic :up:

GHW_Chronic 11-23-2007 08:12

Re: GHW Connect Messages
I had a very similar idea which I was planning on implementing (and just did). It's pretty much the same thing so thx for sharing your idea and reminding me.

Alka 11-23-2007 08:19

Re: GHW Connect Messages
Gj, now is pretty cool. ;-)

M249-M4A1 11-23-2007 17:57

Re: GHW Connect Messages
I haven't seen a new GHW script in ages!

GHW_Chronic 11-23-2007 22:00

Re: GHW Connect Messages
fixed a bug where I used MSG_ALL instead of MSG_ONE and it would cause the message to appear possibly several times

Defillbert 11-23-2007 23:24

Re: GHW Connect Messages
You, sir, have done it again. :up:

All times are GMT -4. The time now is 16:30.

Powered by vBulletin®
Copyright ©2000 - 2016, vBulletin Solutions, Inc.