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

[HELP] Add connect/disconnect Sound


Post New Thread Reply   
 
Thread Tools Display Modes
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-15-2014 , 08:35   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #11

I don't think there are include in cstrike package.

You have to download first 1.8.3-dev-hg193-base.zip
Then you extract the cstrike package in it.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 02-15-2014 , 12:32   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #12

Sorry for being retarded lol. That was a horrible mistake....

Fixed:
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))
    
    new 
zOption OPTION
    
    
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

Quote:
Originally Posted by Blizzard_87 View Post
baws can you tell me whats wrong with this code?
Yes lol Look up. I was just going to leave to a Valentines Party so i did it fast but fixed. c:
__________________
Like my clean plugins and work?

Last edited by Baws; 02-15-2014 at 12:34.
Baws is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 02-15-2014 , 16:37   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #13

Quote:
Originally Posted by baws View Post
Sorry for being retarded lol. That was a horrible mistake....

Fixed:
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))
    
    new 
zOption OPTION
    
    
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


Yes lol Look up. I was just going to leave to a Valentines Party so i did it fast but fixed. c:
Have you tested this code?

Your disconnect message will not work as your switch starts from 4 to 6 and your OPTION is set to 3 only.

Your colourchat messages either have too many %s in them or your trying to get a integer but you don't have anything trying the get players rank.

So plz tell me I'm blind? Or can you go thru your code again.
__________________
Blizzard_87 is offline
PepsiSexy
Member
Join Date: Aug 2013
Old 02-15-2014 , 17:01   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #14

I dont understand why one of the best coders ConnorMcLeod sees this thread and replys but dont help this guy to make the code working, why dont u do that for him Connor?
PepsiSexy is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 02-15-2014 , 17:39   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #15

I don't know why, but thanks for the courage and help your giving me Blizzard! I'm learning something! Thanks!

Fixed:
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 ^x01 has connected from^x04 %s"IsUserAdmin(id) ? "Admin" "Player",  szNameszCountry); 
            
client_cmd0"spk %s"CN_SOUND 
        } 
        case 
2
        { 
            
ColorChat(0COLOR"^x04%s ^x01 has connected from^x04 %s"IsUserAdmin(id) ? "Admin" "Player",  szNameszCountry); 
            
client_cmd0"spk %s"CN_SOUND 
        } 
        case 
3
        { 
            
ColorChat(0COLOR"^x04%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)) 
     
    new 
zOption OPTION 
     
    
switch (zOption
    { 
        case 
1
        { 
            
ColorChat(0COLOR"^x04%s ^x01 has disconnected from^x04 %s."IsUserAdmin(id) ? "Admin" "Player",  szNameszCountry); // Removed:  (rank %i) - In your code there's nothing for the rank coding. so %i is just nothing.
            
client_cmd0"spk %s"DC_SOUND 
        } 
        case 
2
        { 
            
ColorChat(0COLOR"^x04%s ^x01 has disconnected from^x04 %s."IsUserAdmin(id) ? "Admin" "Player",  szNameszCountry); // Removed:  (rank %i) - In your code there's nothing for the rank coding. so %i is just nothing.
            
client_cmd0"spk %s"DC_SOUND 
        } 
        case 
3
        { 
            
ColorChat(0COLOR"^x04%s ^x01 has disconnected from^x04 %s."IsUserAdmin(id) ? "Admin" "Player",  szNameszCountry); // Removed:  (rank %i) - In your code there's nothing for the rank coding. so %i is just nothing.
            
client_cmd0"spk %s"DC_SOUND 
        } 
    } 
    return 
PLUGIN_HANDLED 

__________________
Like my clean plugins and work?

Last edited by Baws; 02-15-2014 at 17:42.
Baws is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-16-2014 , 03:57   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #16

Quote:
Originally Posted by PepsiSexy View Post
I dont understand why one of the best coders ConnorMcLeod sees this thread and replys but dont help this guy to make the code working, why dont u do that for him Connor?
OP asked for a complete plugin, not for scripting help, i made him a plugin and helped him to run it.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 02-16-2014 , 03:57   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #17

Quote:
Originally Posted by PepsiSexy View Post
I dont understand why one of the best coders ConnorMcLeod sees this thread and replys but dont help this guy to make the code working, why dont u do that for him Connor?
he (or other good coders) correct wrong stuff sometimes, when having time, not tired or bored, etc. they have a life too, never forget it .
__________________
ANTICHRISTUS is offline
5aloOod
Senior Member
Join Date: Jun 2013
Location: hell
Old 02-16-2014 , 07:03   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #18

Thanks Connor and baws for your help
5aloOod is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 02-16-2014 , 11:12   Re: [HELP] Add connect/disconnect Sound
Reply With Quote #19

Quote:
Originally Posted by 5aloOod View Post
Thanks Connor and baws for your help
No problem!
__________________
Like my clean plugins and work?
Baws 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 17:15.


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