Raised This Month: $51 Target: $400
 12% 

[HELP] Add connect/disconnect Sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
5aloOod
Senior Member
Join Date: Jun 2013
Location: hell
Old 02-15-2014 , 00:21   [HELP] Add connect/disconnect Sound
Reply With Quote #1

Hello
i need a small help to add connect/disconnect Sound for this plugin
sounds from GHW plugin's
PHP Code:
"buttons/bell1.wav"
    "fvox/blip.wav" 
PHP Code:
/*
* * *
* Credits to FlyingHorse for original plugin!
* * *
*/

#include <amxmodx>
#include <amxmisc>
#include <geoip>
#include <csx>
#include <colorchat>

//Start editing here.
#define OPTION     3
#define COLOR        RED
//Stop editing here.

#define IsUserAdmin(%1)    (get_user_flags(%1) & ADMIN_KICK)

public plugin_init() 
{
    
register_plugin("Connect messages""2.0""P1raten")
}
    
public 
client_putinserver(id
{
    new 
szName[32], szIP[21], szCountry[46]
    
get_user_name(idszNamecharsmax(szName))
    
get_user_ip(idszIPcharsmax(szIP))
    
geoip_country(szIPszCountrycharsmax(szCountry))
    
    new 
zOption OPTION
    
    
switch (zOption
    {
        case 
1:
            
ColorChat(0COLOR"^x04%s %s^x01 has connected from^x04 %s"IsUserAdmin(id) ? "Admin" "Player"szCountry);
        case 
2:
            
ColorChat(0COLOR"^x04%s %s^x01 has connected from^x04 %s"IsUserAdmin(id) ? "Admin" "Player"szName);
        case 
3:
            
ColorChat(0COLOR"^x04%s %s^x01 has connected from^x04 %s"IsUserAdmin(id) ? "Admin" "Player"szNameszCountry);
    }
    return 
PLUGIN_HANDLED
}
public 
client_disconnect(id)
{
    new 
szName[32], szIP[21], szCountry[46]
    
get_user_name(idszNamecharsmax(szName))
    
get_user_ip(idszIPcharsmax(szIP))
    
geoip_country(szIPszCountrycharsmax(szCountry))
    
    switch (
zOption)
    {
        case 
4:
            
ColorChat(0COLOR"^x04%s %s^x01 has disconnected from^x04 %s (rank %i)"IsUserAdmin(id) ? "Admin" "Player"szCountry);
        case 
5:
            
ColorChat(0COLOR"^x04%s %s^x01 has disconnected from^x04 %s (rank %i)"IsUserAdmin(id) ? "Admin" "Player"szName);
        case 
6:
            
ColorChat(0COLOR"^x04%s %s^x01 has disconnected from^x04 %s (rank %i)"IsUserAdmin(id) ? "Admin" "Player"szNameszCountry);
    }
    return 
PLUGIN_HANDLED

thanks

Last edited by 5aloOod; 02-15-2014 at 00:25.
5aloOod is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 02-15-2014 , 00:45   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #2

Here you go:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <geoip>
#include <csx>
#include <colorchat>

//Start editing here.
#define OPTION     3
#define COLOR        RED
//Stop editing here.

#define CN_SOUND    "buttons/bell1.wav"    // Connect sound 
#define DC_SOUND    "fvox/blip.wav"        // Disconnect sound 

#define IsUserAdmin(%1)    (get_user_flags(%1) & ADMIN_KICK)

public plugin_init() 
{
    
register_plugin("Connect messages""2.0""P1raten")
}
    
public 
client_putinserver(id
{
    new 
szName[32], szIP[21], szCountry[46]
    
get_user_name(idszNamecharsmax(szName))
    
get_user_ip(idszIPcharsmax(szIP))
    
geoip_country(szIPszCountrycharsmax(szCountry))
    
    new 
zOption OPTION
    
    
switch (zOption
    {
        case 
1:
            
ColorChat(0COLOR"^x04%s %s^x01 has connected from^x04 %s"IsUserAdmin(id) ? "Admin" "Player"szCountry);
            
client_cmd0"spk %s"CN_SOUND )
        case 
2:
            
ColorChat(0COLOR"^x04%s %s^x01 has connected from^x04 %s"IsUserAdmin(id) ? "Admin" "Player"szName);
            
client_cmd0"spk %s"CN_SOUND )
        case 
3:
            
ColorChat(0COLOR"^x04%s %s^x01 has connected from^x04 %s"IsUserAdmin(id) ? "Admin" "Player"szNameszCountry);
            
client_cmd0"spk %s"CN_SOUND )
    }
    return 
PLUGIN_HANDLED
}
public 
client_disconnect(id)
{
    new 
szName[32], szIP[21], szCountry[46]
    
get_user_name(idszNamecharsmax(szName))
    
get_user_ip(idszIPcharsmax(szIP))
    
geoip_country(szIPszCountrycharsmax(szCountry))
    
    switch (
zOption)
    {
        case 
4:
            
ColorChat(0COLOR"^x04%s %s^x01 has disconnected from^x04 %s (rank %i)"IsUserAdmin(id) ? "Admin" "Player"szCountry);
            
client_cmd0"spk %s"DC_SOUND )
        case 
5:
            
ColorChat(0COLOR"^x04%s %s^x01 has disconnected from^x04 %s (rank %i)"IsUserAdmin(id) ? "Admin" "Player"szName);
            
client_cmd0"spk %s"DC_SOUND )
        case 
6:
            
ColorChat(0COLOR"^x04%s %s^x01 has disconnected from^x04 %s (rank %i)"IsUserAdmin(id) ? "Admin" "Player"szNameszCountry);
            
client_cmd0"spk %s"DC_SOUND )
    }
    return 
PLUGIN_HANDLED

I know it from my Surf Vip plugin c:
__________________
Like my clean plugins and work?
Baws is offline
5aloOod
Senior Member
Join Date: Jun 2013
Location: hell
Old 02-15-2014 , 01:51   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #3

thanks for your fast replay
the code you post gives So Many errors in local compiler
please some one fix the code
screenshot -->
Attached Thumbnails
Click image for larger version

Name:	Untitled.jpg
Views:	134
Size:	101.7 KB
ID:	130620  

Last edited by 5aloOod; 02-15-2014 at 02:44.
5aloOod is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 02-15-2014 , 03:31   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #4

Quote:
Originally Posted by baws View Post
Here you go:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <geoip>
#include <csx>
#include <colorchat>

//Start editing here.
#define OPTION     3
#define COLOR        RED
//Stop editing here.

#define CN_SOUND    "buttons/bell1.wav"    // Connect sound 
#define DC_SOUND    "fvox/blip.wav"        // Disconnect sound 

#define IsUserAdmin(%1)    (get_user_flags(%1) & ADMIN_KICK)

public plugin_init() 
{
    
register_plugin("Connect messages""2.0""P1raten")
}
    
public 
client_putinserver(id
{
    new 
szName[32], szIP[21], szCountry[46]
    
get_user_name(idszNamecharsmax(szName))
    
get_user_ip(idszIPcharsmax(szIP))
    
geoip_country(szIPszCountrycharsmax(szCountry))
    
    new 
zOption OPTION
    
    
switch (zOption
    {
        case 
1:
            
ColorChat(0COLOR"^x04%s %s^x01 has connected from^x04 %s"IsUserAdmin(id) ? "Admin" "Player"szCountry);
            
client_cmd0"spk %s"CN_SOUND )
        case 
2:
            
ColorChat(0COLOR"^x04%s %s^x01 has connected from^x04 %s"IsUserAdmin(id) ? "Admin" "Player"szName);
            
client_cmd0"spk %s"CN_SOUND )
        case 
3:
            
ColorChat(0COLOR"^x04%s %s^x01 has connected from^x04 %s"IsUserAdmin(id) ? "Admin" "Player"szNameszCountry);
            
client_cmd0"spk %s"CN_SOUND )
    }
    return 
PLUGIN_HANDLED
}
public 
client_disconnect(id)
{
    new 
szName[32], szIP[21], szCountry[46]
    
get_user_name(idszNamecharsmax(szName))
    
get_user_ip(idszIPcharsmax(szIP))
    
geoip_country(szIPszCountrycharsmax(szCountry))
    
    switch (
zOption)
    {
        case 
4:
            
ColorChat(0COLOR"^x04%s %s^x01 has disconnected from^x04 %s (rank %i)"IsUserAdmin(id) ? "Admin" "Player"szCountry);
            
client_cmd0"spk %s"DC_SOUND )
        case 
5:
            
ColorChat(0COLOR"^x04%s %s^x01 has disconnected from^x04 %s (rank %i)"IsUserAdmin(id) ? "Admin" "Player"szName);
            
client_cmd0"spk %s"DC_SOUND )
        case 
6:
            
ColorChat(0COLOR"^x04%s %s^x01 has disconnected from^x04 %s (rank %i)"IsUserAdmin(id) ? "Admin" "Player"szNameszCountry);
            
client_cmd0"spk %s"DC_SOUND )
    }
    return 
PLUGIN_HANDLED

I know it from my Surf Vip plugin c:
baws can you tell me whats wrong with this code?
__________________
Blizzard_87 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-15-2014 , 04:28   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #5

Try this, needs amxx1.8.3 to take full advantage on integrated colorchat system.

cvar "connect_flags" flags :

Code:
a - display country in connect msg
b - display name in connect msg
c - play connect sound
d - display country in disconnect msg
e - display name in disconnect msg
f - play disconnect sound
Spoiler
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
5aloOod
Senior Member
Join Date: Jun 2013
Location: hell
Old 02-15-2014 , 05:11   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #6

still getting errors :/
Quote:
error 017: undefined symbol "client_print_color"
warning 215: expression has no effect
warning 215: expression has no effect
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
5aloOod is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 02-15-2014 , 05:40   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #7

ConnorMcLeod did say you need latest amxmodx. 183
__________________
Blizzard_87 is offline
5aloOod
Senior Member
Join Date: Jun 2013
Location: hell
Old 02-15-2014 , 06:09   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #8

Crazy Question,
where is amxmodx 1.8.3 ?
there is only 1.8.2 on the downloads section
http://www.amxmodx.org/downloads.php

Last edited by 5aloOod; 02-15-2014 at 06:10.
5aloOod is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 02-15-2014 , 06:21   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #9

Quote:
Originally Posted by 5aloOod View Post
Crazy Question,
where is amxmodx 1.8.3 ?
there is only 1.8.2 on the downloads section
http://www.amxmodx.org/downloads.php
http://www.amxmodx.org/snapshots.php
__________________
Blizzard_87 is offline
5aloOod
Senior Member
Join Date: Jun 2013
Location: hell
Old 02-15-2014 , 08:01   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #10

i have downloaded this file
amxmodx-1.8.3-dev-hg193-cstrike-windows.zip

but nothing changed with the compile
same errors
5aloOod is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:34.


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