AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   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:

IneedHelp 11-24-2007 01:53

Re: GHW Connect Messages
 
NICE PLUGIN GHW ! Gj:)

nukey451 11-24-2007 16:59

Re: GHW Connect Messages
 
WoW :up: This Plugin must every Server have :)

Test it CounterStrike 1.6 ..... OWNED ! :P

Tramp 11-25-2007 06:50

Re: GHW Connect Messages
 
I found bug.

When cm_flags is set to "4"
Text isn't coloured.

dangerix 11-25-2007 06:59

Re: GHW Connect Messages
 
It's not a bug, your usage is wrong. The flags are additive. If you want to use SHOW_COLOR, SHOW_CONNECT and SHOW_DISCONNECT, it's cm_flags 7.

Tramp 11-26-2007 10:56

Re: GHW Connect Messages
 
Quote:

Originally Posted by dangerix (Post 556560)
It's not a bug, your usage is wrong. The flags are additive. If you want to use SHOW_COLOR, SHOW_CONNECT and SHOW_DISCONNECT, it's cm_flags 7.

So it should be written in instruction ?

GHW_Chronic 11-26-2007 10:58

Re: GHW Connect Messages
 
Quote:

Originally Posted by GHW_Chronic (Post 555912)
  • 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)

it is

Simon Logic 11-26-2007 12:03

Re: GHW Connect Messages
 
I think SHOW_COLOR is redundant because you can freely put color codes (so, worth to make contants like %green, %red, %blue etc) into format string. But you need a new cvar which defines default color also.

PS. Is it properly to define cvars within plugin_precache() ?

PSS. LAN ip is 10.0.0.0/8 & 172.[16-31].0.0/16 also.

PSSS. Also you forgot to handle "127.0.0.1" ip (compare with "127." is enough) because when you're connecting to dedicated server from the same ip you get "127.0.0.1" ip instead of "loopback" (at least on win32 platform)

GHW_Chronic 11-26-2007 14:47

Re: GHW Connect Messages
 
Quote:

Originally Posted by Simon Logic (Post 557080)
PS. Is it properly to define cvars within plugin_precache() ?

if you don't register CVARs used in plugin_precache in plugin_precache they are not set yet (because plugin_precache is called before plugin_init). So thus one the first map the first time the plugin is loaded / every server reset (unless CVARs are defined in amxx.cfg) the sounds wouldn't work.

As for the rest I give you a nice: ¡maybe!

purple nurple 11-30-2007 18:09

Re: GHW Connect Messages
 
Could you make a option for it to tell how many times the player has been in the server? and maybe if there name has changed show there old name. just a suggestion but you could use nvault for counting the number of times a player has been in the server.

rumbeto 12-11-2007 18:03

Re: GHW Connect Messages
 
I think I'm stupid.
I put the following in server.cfg :
cm_connect_string "[AMXX] %name has connected (%ip)"
cm_disconnect_string "[AMXX] %name has disconnected (%ip)"
but it still shows the default ones.

Where am I wrong?
Thanks.

GHW_Chronic 12-11-2007 18:17

Re: GHW Connect Messages
 
put that into amxx.cfg

rumbeto 12-12-2007 13:10

Re: GHW Connect Messages
 
I thought so. I just didn't have a chance to experiment. I don't have a CS installation right now and I can't see the results right away. Should be the value of cm_connect_string cvar be in " "?

GHW_Chronic 12-12-2007 13:12

Re: GHW Connect Messages
 
yes

rumbeto 12-12-2007 13:50

Re: GHW Connect Messages
 
Thnanks a lot.

addi1212 12-30-2007 17:49

Re: GHW Connect Messages
 
Please Help me,

i have uploaded the "GHW_connect.amxx" to my plugins-Folder,
and have the Plugin in plugins.ini registered, but the does not work.

Wich other Files & Entries i must modyfing before ?
Please give me a simple guidance. Thx


(Sorry for my terrible english)

GHW_Chronic 12-30-2007 22:18

Re: GHW Connect Messages
 
that's all you have to do. download the GHW_connect.amxx file and add the following line to the end of plugins.ini:
Code:

GHW_connect.amxx

lIl_sAiNt 01-01-2008 07:24

Re: GHW Connect Messages
 
One word,.,.,awesome plug
-but,can you add like a rank next to show country
-ex.
[AMXX] lol (STEAM_0:0:7064509) has connected (Korea, Republic of) rank1 of 9......
-kinda like that,with colors
-thanx

hackandmore 01-02-2008 06:44

Re: GHW Connect Messages
 
i need that too.Couldn't find it.Know i saw it on a server.A link anyone?

anakin_cstrike 03-14-2008 07:02

Re: GHW Connect Messages
 
Owesome:)

fyndler 03-28-2008 23:43

Re: GHW Connect Messages
 
How can i disable the sounds when ppl connect and disconnect ?

spiderbites 03-29-2008 02:22

Re: GHW Connect Messages
 
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)
set cm_flags 7

dangerix 04-10-2008 10:25

Re: GHW Connect Messages
 
OT:
Could a kind moderator move this topic to "High-Traffic Plugins > GHW_Chronic's Scripts", please?
I always end up not finding it there when I'm looking for it :/

//edit:
Thank you ;)

gamersolid 04-20-2008 02:43

Re: GHW Connect Messages
 
how can i change the txt color?

GHW_Chronic 04-21-2008 05:34

Re: GHW Connect Messages
 
you can't

rooney_09 04-25-2008 17:32

Re: GHW Connect Messages
 
:) WOW very nice. Can you display ip, country and name ( no steamID ) ?

GHW_Chronic 04-25-2008 21:55

Re: GHW Connect Messages
 
Copy and paste into your amxx.cfg:
Code:

cm_connect_string "[AMXX] %name (%ip) has connected (%country)."
cm_disconnect_string "[AMXX] %name (%ip) has disconnected (%country)."


OpenMind 04-29-2008 16:34

Re: GHW Connect Messages
 
Great plugin.
I have one problem with it though. On player connect, 80% of the time it shows "unknown country" instead of the players country.
Am I doing something wrong?

spiderbites 04-29-2008 19:24

Re: GHW Connect Messages
 
update your geoip.dat

search around this forum how to do that.

OpenMind 04-30-2008 08:32

Re: GHW Connect Messages
 
Worked fine, thank you.

Zul Rivers 05-25-2008 08:00

Re: GHW Connect Messages
 
i have a problem, anyone whom enters or leave my server, i get this..
Code:

Name from Unknown Country has connected.
or
Name from Unknown Country has disconnected.

i have updated to the latest geoip.dat but i still get the same results..
pls help :(

- i used the auto-installer for superheromod for my server


All times are GMT -4. The time now is 14:39.

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