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

[REQ] sound when round is over


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xElior
Junior Member
Join Date: Sep 2013
Old 05-14-2015 , 19:16   [REQ] sound when round is over
Reply With Quote #1

Hello,
I have been looking for a plugin that sounds a 7 seconds long song when the round is over (either if the CT team wins, or the T team wins. It doesn't matter).
And that this song will be played to everybody, all connected players in the server whether if they are alive, or dead, or spectating.
I need a simple one, that only sounds same ONE song that I want EVERYTIME round ends.
It would be also nice to have a cvar to enable and disable plugin, and also client command that shuts off this sound.
Thank you very much!!!
__________________
Sincerely, Elior

Last edited by xElior; 05-15-2015 at 12:10.
xElior is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-15-2015 , 10:06   Re: [REQ] sound when round is over
Reply With Quote #2

Tell me if that's what your request:
Code:
/* Plugin generated by AMXX-Studio */

#include < amxmodx >

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new g_pAutoSound;

new const g_szWinTeam[] = "***/XXX.mp3"; // *** That name of Folder after sound/ + change the name XXX to name mp3

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_logevent( "EventRoundEnd", 2, "1=Round_End" );
    
    g_pAutoSound = register_cvar( "amx_autosound", "1" );
}

public plugin_precache()
{
    precache_sound( g_szWinTeam );
}

public EventRoundEnd()
{
    if (!get_pcvar_num( g_pAutoSound ) ) // dont sure if that will work = I retired two months ago from programming
                return;
        
    client_cmd( 0, "spk ^"%s^"", g_szWinTeam );
}


// if my code wrong that another way

//    new players[ 32 ], pnum;
//    new tCount, ctCount;
//    get_players( players, pnum, "c" );
    
//    for( new i = 0; i < pnum; i++ )
//    {
//        if( !is_user_connected( players[ i ] ) )
//            continue;
        
//        switch( cs_get_user_team( players[ i ] ) )
//        {
//            case CS_TEAM_T: 
//                client_cmd( i, "spk ^"%s^"", g_szWinTeam );
            
//            case CS_TEAM_CT: 
//                client_cmd( i, "spk ^"%s^"", g_szWinTeam );
//        }
//    }

Last edited by Fuck For Fun; 05-15-2015 at 12:31.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
secondtimesold
Senior Member
Join Date: Feb 2015
Old 05-15-2015 , 10:43   Re: [REQ] sound when round is over
Reply With Quote #3

https://forums.alliedmods.net/showthread.php?t=233103
__________________
secondtimesold is offline
xElior
Junior Member
Join Date: Sep 2013
Old 05-15-2015 , 12:15   Re: [REQ] sound when round is over
Reply With Quote #4

Quote:
Originally Posted by Fuck For Fun View Post
Tell me if that's what your request for:
Code:
/* Plugin generated by AMXX-Studio */

#include < amxmodx >

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new g_pAutoSound;

new const g_szWinTeam[] = "XXX.mp3"; // change the name XXX to name mp3 (use mp3 became wav)

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_logevent( "EventRoundEnd", 2, "1=Round_End" );
    
    g_pAutoSound = register_cvar( "amx_autosound", "1" );
}

public plugin_precache()
{
    precache_sound( g_szWinTeam );
}

public EventRoundEnd()
{
    if (!get_pcvar_num( g_pAutoSound ) ) // dont sure if that will work = I retired two months ago from programming
                return;
        
    client_cmd( 0, "spk ^"%s^"", g_szWinTeam );
}


// if my code wrong that another way

//    new players[ 32 ], pnum;
//    new tCount, ctCount;
//    get_players( players, pnum, "c" );
    
//    for( new i = 0; i < pnum; i++ )
//    {
//        if( !is_user_connected( players[ i ] ) )
//            continue;
        
//        switch( cs_get_user_team( players[ i ] ) )
//        {
//            case CS_TEAM_T: 
//                client_cmd( i, "spk ^"%s^"", g_szWinTeam );
            
//            case CS_TEAM_CT: 
//                client_cmd( i, "spk ^"%s^"", g_szWinTeam );
//        }
//    }
First of all, thank you very much for your help.
Secondly, I am not quite sure where should I locate the sound.. there is no exact location to place it in your code,
maybe I will put in 'sounds' file?

Quote:
Originally Posted by secondtimesold View Post
My request is an AMXX plugin for Counter-Strike 1.6
Thanks anyways
__________________
Sincerely, Elior

Last edited by xElior; 05-15-2015 at 12:16.
xElior is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 05-15-2015 , 12:22   Re: [REQ] sound when round is over
Reply With Quote #5

https://forums.alliedmods.net/showthread.php?t=6784
__________________

Mordekay is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-15-2015 , 12:31   Re: [REQ] sound when round is over
Reply With Quote #6

Quote:
Originally Posted by xElior View Post
First of all, thank you very much for your help.
Secondly, I am not quite sure where should I locate the sound.. there is no exact location to place it in your code,
maybe I will put in 'sounds' file?



My request is an AMXX plugin for Counter-Strike 1.6
Thanks anyways
Edit my Post.

check again.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
bat
Veteran Member
Join Date: Jul 2012
Old 05-16-2015 , 04:11   Re: [REQ] sound when round is over
Reply With Quote #7

PHP Code:
#include amxmodx
#include fakemeta

new const data[][] =
{
      
"2&%!MRAD_terwin",
      
"2&%!MRAD_ctwin",
      
"2&%!MRAD_rounddraw"
}

new const 
Soundlist[][] =
{
      
"roundsound/winsound1.wav",
      
"roundsound/winsound2.wav",
      
"roundsound/winsound3.wav",
      
"roundsound/winsound4.wav",
      
"roundsound/winsound5.wav",
      
"roundsound/winsound6.wav",
      
"roundsound/winsound7.wav",
      
"roundsound/winsound8.wav",
      
"roundsound/winsound9.wav",
      
"roundsound/winsound10.wav"
}

new 
bool:getsound[MAX_PLAYERS 1]

#define TASKID_ADS   1666

public plugin_init() 
{           
       for(new 
0sizeof datai++) 
           
register_event("SendAudio""playsound""a"data[i])

       
register_clcmd("say /ers""cmd_check")

}

public 
plugin_precache() for(new 0sizeof Soundlisti++) precache_sound(Soundlist[i])

public 
client_authorized(idgetsound[id] = true

public client_disconnect(id
{
       
getsound[id] = true
       remove_task
(id TASKID_ADS)
}

public 
client_putinserver(id
{
       
remove_task(id TASKID_ADS)
       
set_task(60.0"showmessage"id TASKID_ADS__, .flags "b")
}

public 
playsound()
{
       static 
iPlayers[32],iNum,pid
       get_players
(iPlayersiNum"c")

       for(new 
iiNumi++)
       {
            
pid iPlayers[i]
           
            if(
getsound[pid] == true)
            {
                 
SendAudioWin(0pidSoundlist[random_num(0sizeof Soundlist -1)])
            }
       }
}

public 
cmd_check(id)
{
       
getsound[id] = getsound[id] ? false true
       client_print_center
(id"Endround sound: %s"getsound[id] ? "Enabled" "Disabled")
}

public 
showmessage(taskid)
{
        new 
id taskid TASKID_ADS
        client_print
(idprint_chat"[AMXX] Say /ers to enable or disable the end round sounds for you")
}     

SendAudioWin(const play, const receiver, const sound[], const pitch 100)
{
    
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SendAudio"), .player receiver)
    
write_byte(play)
    
write_string(sound)
    
write_short(pitch)
    
message_end()
}

client_print_center(idmsg[], any:...)
{
    static 
szMsg[128]
    
vformat(szMsg127msg3)

    
engfunc(EngFunc_ClientPrintfid1szMsg)

__________________
bat is offline
Send a message via Skype™ to bat
mohsen9010
Senior Member
Join Date: Jun 2011
Location: Iran
Old 05-16-2015 , 10:22   Re: [REQ] sound when round is over
Reply With Quote #8

https://forums.alliedmods.net/showthread.php?p=499872 or https://forums.alliedmods.net/showth...?t=6784?t=6784 or https://forums.alliedmods.net/showthread.php?p=638940
__________________
Iman in Allah
mohsen9010 is offline
Send a message via Yahoo to mohsen9010 Send a message via Skype™ to mohsen9010
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 13:05.


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