AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   GHW_Chronic's Scripts (https://forums.alliedmods.net/forumdisplay.php?f=97)
-   -   GHW Connect Messages (https://forums.alliedmods.net/showthread.php?t=63507)

GHW_Chronic 11-23-2007 06:06

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

Features:
  • Colored Text
  • Customizable
  • Connect/Disconnect Sounds

CVARs:
  • 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
    • 4 - SHOW_DISCONNECT
    • 8 - PLAY_SOUND_CONNECT
    • 16 - PLAY_SOUND_DISCONNECT
    • 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 06: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 ?

Code:
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 06: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 06: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:
Code:

                        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 06:53

Re: GHW Connect Messages
 
GJ GHW_Chronic :up:

GHW_Chronic 11-23-2007 07: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 07:19

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

M249-M4A1 11-23-2007 16:57

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

GHW_Chronic 11-23-2007 21: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 22:24

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


All times are GMT -4. The time now is 11:59.

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