AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [REQ] sound when round is over (https://forums.alliedmods.net/showthread.php?t=262886)

xElior 05-14-2015 19:16

[REQ] sound when round is over
 
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!!!

Fuck For Fun 05-15-2015 10:06

Re: [REQ] sound when round is over
 
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 );
//        }
//    }


secondtimesold 05-15-2015 10:43

Re: [REQ] sound when round is over
 
https://forums.alliedmods.net/showthread.php?t=233103

xElior 05-15-2015 12:15

Re: [REQ] sound when round is over
 
Quote:

Originally Posted by Fuck For Fun (Post 2296961)
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 (Post 2296977)

My request is an AMXX plugin for Counter-Strike 1.6
Thanks anyways

Mordekay 05-15-2015 12:22

Re: [REQ] sound when round is over
 
https://forums.alliedmods.net/showthread.php?t=6784

Fuck For Fun 05-15-2015 12:31

Re: [REQ] sound when round is over
 
Quote:

Originally Posted by xElior (Post 2297011)
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.

bat 05-16-2015 04:11

Re: [REQ] sound when round is over
 
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)



mohsen9010 05-16-2015 10:22

Re: [REQ] sound when round is over
 
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


All times are GMT -4. The time now is 20:19.

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