Raised This Month: $68 Target: $400
 17% 

[CSS]RoundSound++


Post New Thread Reply   
 
Thread Tools Display Modes
XxForcasterxX
New Member
Join Date: Dec 2013
Old 12-07-2013 , 23:37   Re: [CSS]RoundSound++
Reply With Quote #101

This is a nice plugin! but can i add custom songs?
XxForcasterxX is offline
matheusfragaa
Junior Member
Join Date: Jan 2014
Old 01-01-2014 , 23:45   Re: [CSS]RoundSound++
Reply With Quote #102

matheusfragaa is offline
Shark_css
New Member
Join Date: Jan 2014
Old 01-06-2014 , 14:05   Re: [CSS]RoundSound++
Reply With Quote #103

Hello,

I installed the plugin on my server , I added some songs but the times of when a team wins gives the following error ( L 01/06/2014 - 19:086 : . [ . RoundSound smx + + ] No team has win the round )

I have the following configuration :

/ **
** Antichrist RoundSound + +
** -------------------------
** Changelog
** changelog.txt
** Readme
** readme.txt
** Credits
** Old CS 1.6 Plugin
** By " PaintLancer "
** Thxs
** To NAT for his help!
** -------------------------
** By Thanatos aka Antichrist
** /
# include <sourcemod>
# include <sdktools>
# include <sdktools_sound>
# include <console>
# include <string>

# pragma semicolon 1

# define PLUGIN_VERSION " 1.1.0 "
# define MAX_FILE_LEN 256

new Handle : g_hEnabled = INVALID_HANDLE ;
new bool : g_bEnabled = true ;

public Plugin : myinfo = {
name = " RoundSound + + "
author = " Antichrist "
description = " Plays the Sound at RoundEnd . "
version = PLUGIN_VERSION ,
url = " http://passionfighters.de "
} ;

public OnPluginStart ( ) {
CreateConVar ( " sm_roundsound_version " PLUGIN_VERSION , " + + RoundSound version . " FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY );
g_hEnabled = CreateConVar ( " sm_roundsound_enable " , " 1 " , " RoundSound + + Enable / Disable CVar . " FCVAR_PLUGIN | FCVAR_NOTIFY ) ;

HookEvent ( " round_end " EventRoundEnd );
HookConVarChange ( g_hEnabled , CVarEnabled );
}

public OnMapStart ( )
{
decl String : tewin_snd1 [ MAX_FILE_LEN ] ;
decl String : tewin_snd2 [ MAX_FILE_LEN ] ;
decl String : tewin_snd3 [ MAX_FILE_LEN ] ;
decl String : tewin_snd4 [ MAX_FILE_LEN ] ;
decl String : tewin_snd5 [ MAX_FILE_LEN ] ;
decl String : tewin_snd6 [ MAX_FILE_LEN ] ;
decl String : tewin_snd7 [ MAX_FILE_LEN ] ;
decl String : tewin_snd8 [ MAX_FILE_LEN ] ;
decl String : tewin_snd9 [ MAX_FILE_LEN ] ;
decl String : tewin_snd10 [ MAX_FILE_LEN ] ;
decl String : tewin_snd11 [ MAX_FILE_LEN ] ;
decl String : tewin_snd12 [ MAX_FILE_LEN ] ;
decl String : ctwin_snd1 [ MAX_FILE_LEN ] ;
decl String : ctwin_snd2 [ MAX_FILE_LEN ] ;
decl String : ctwin_snd3 [ MAX_FILE_LEN ] ;
decl String : ctwin_snd4 [ MAX_FILE_LEN ] ;
decl String : ctwin_snd5 [ MAX_FILE_LEN ] ;
decl String : ctwin_snd6 [ MAX_FILE_LEN ] ;
decl String : ctwin_snd7 [ MAX_FILE_LEN ] ;
decl String : ctwin_snd8 [ MAX_FILE_LEN ] ;
decl String : ctwin_snd9 [ MAX_FILE_LEN ] ;
decl String : ctwin_snd10 [ MAX_FILE_LEN ] ;
decl String : ctwin_snd11 [ MAX_FILE_LEN ] ;
decl String : ctwin_snd12 [ MAX_FILE_LEN ] ;

Format ( tewin_snd1 , sizeof ( tewin_snd1 ) , " sound/misc/twinner1.mp3 " ) ;
Format ( tewin_snd2 , sizeof ( tewin_snd2 ) , " sound/misc/twinner2.mp3 " ) ;
Format ( tewin_snd3 , sizeof ( tewin_snd3 ) , " sound/misc/twinner3.mp3 " ) ;
Format ( tewin_snd4 , sizeof ( tewin_snd4 ) , " sound/misc/twinner4.mp3 " ) ;
Format ( tewin_snd5 , sizeof ( tewin_snd5 ) , " sound/misc/twinner5.mp3 " ) ;
Format ( tewin_snd6 , sizeof ( tewin_snd6 ) , " sound/misc/twinner6.mp3 " ) ;
Format ( tewin_snd7 , sizeof ( tewin_snd7 ) , " sound/misc/twinner7.mp3 " ) ;
Format ( tewin_snd8 , sizeof ( tewin_snd8 ) , " sound/misc/twinner8.mp3 " ) ;
Format ( tewin_snd9 , sizeof ( tewin_snd9 ) , " sound/misc/twinner9.mp3 " ) ;
Format ( tewin_snd10 , sizeof ( tewin_snd10 ) , " sound/misc/twinner10.mp3 " ) ;
Format ( tewin_snd11 , sizeof ( tewin_snd11 ) , " sound/misc/twinner11.mp3 " ) ;
Format ( tewin_snd12 , sizeof ( tewin_snd12 ) , " sound/misc/twinner12.mp3 " ) ;
Format ( ctwin_snd1 , sizeof ( ctwin_snd1 ) , " sound/misc/ctwinner1.mp3 " ) ;
Format ( ctwin_snd2 , sizeof ( ctwin_snd2 ) , " sound/misc/ctwinner2.mp3 " ) ;
Format ( ctwin_snd3 , sizeof ( ctwin_snd3 ) , " sound/misc/ctwinner3.mp3 " ) ;
Format ( ctwin_snd4 , sizeof ( ctwin_snd4 ) , " sound/misc/ctwinner4.mp3 " ) ;
Format ( ctwin_snd5 , sizeof ( ctwin_snd5 ) , " sound/misc/ctwinner5.mp3 " ) ;
Format ( ctwin_snd6 , sizeof ( ctwin_snd6 ) , " sound/misc/ctwinner6.mp3 " ) ;
Format ( ctwin_snd7 , sizeof ( ctwin_snd7 ) , " sound/misc/ctwinner7.mp3 " ) ;
Format ( ctwin_snd8 , sizeof ( ctwin_snd8 ) , " sound/misc/ctwinner8.mp3 " ) ;
Format ( ctwin_snd9 , sizeof ( ctwin_snd9 ) , " sound/misc/ctwinner9.mp3 " ) ;
Format ( ctwin_snd10 , sizeof ( ctwin_snd10 ) , " sound/misc/ctwinner10.mp3 " ) ;
Format ( ctwin_snd11 , sizeof ( ctwin_snd11 ) , " sound/misc/ctwinner11.mp3 " ) ;
Format ( ctwin_snd12 , sizeof ( ctwin_snd12 ) , " sound/misc/ctwinner12.mp3 " ) ;


if ( FileExists ( tewin_snd1 ) && FileExists ( tewin_snd2 ) && FileExists ( tewin_snd3 ) && FileExists ( tewin_snd4 ) && FileExists ( tewin_snd5 ) && FileExists ( tewin_snd6 ) && FileExists ( tewin_snd7 ) && FileExists ( tewin_snd8 ) && FileExists ( tewin_snd9 ) && FileExists ( tewin_snd10 ) && FileExists ( tewin_snd11 ) && FileExists ( tewin_snd12 ) && FileExists ( ctwin_snd1 ) && FileExists ( ctwin_snd2 ) && FileExists ( ctwin_snd3 ) && FileExists ( ctwin_snd4 ) && FileExists ( ctwin_snd5 ) && FileExists ( ctwin_snd6 ) && FileExists ( ctwin_snd7 ) && FileExists ( ctwin_snd8 ) && FileExists ( ctwin_snd9 ) && FileExists ( ctwin_snd10 ) && FileExists ( ctwin_snd11 ) && FileExists ( ctwin_snd12 ) ) {
AddFileToDownloadsTable ( tewin_snd1 );
AddFileToDownloadsTable ( tewin_snd2 );
AddFileToDownloadsTable ( tewin_snd3 );
AddFileToDownloadsTable ( tewin_snd4 );
AddFileToDownloadsTable ( tewin_snd5 );
AddFileToDownloadsTable ( tewin_snd6 );
AddFileToDownloadsTable ( tewin_snd7 );
AddFileToDownloadsTable ( tewin_snd8 );
AddFileToDownloadsTable ( tewin_snd9 );
AddFileToDownloadsTable ( tewin_snd10 );
AddFileToDownloadsTable ( tewin_snd11 );
AddFileToDownloadsTable ( tewin_snd12 );
AddFileToDownloadsTable ( ctwin_snd1 );
AddFileToDownloadsTable ( ctwin_snd2 );
AddFileToDownloadsTable ( ctwin_snd3 );
AddFileToDownloadsTable ( ctwin_snd4 );
AddFileToDownloadsTable ( ctwin_snd5 );
AddFileToDownloadsTable ( ctwin_snd6 );
AddFileToDownloadsTable ( ctwin_snd7 );
AddFileToDownloadsTable ( ctwin_snd8 );
AddFileToDownloadsTable ( ctwin_snd9 );
AddFileToDownloadsTable ( ctwin_snd10 );
AddFileToDownloadsTable ( ctwin_snd11 );
AddFileToDownloadsTable ( ctwin_snd12 );

PrecacheSound ( " misc/ctwinner1.mp3 " , true) ;
PrecacheSound ( " misc/ctwinner2.mp3 " , true) ;
PrecacheSound ( " misc/ctwinner3.mp3 " , true) ;
PrecacheSound ( " misc/ctwinner4.mp3 " , true) ;
PrecacheSound ( " misc/ctwinner5.mp3 " , true) ;
PrecacheSound ( " misc/ctwinner6.mp3 " , true) ;
PrecacheSound ( " misc/ctwinner7.mp3 " , true) ;
PrecacheSound ( " misc/ctwinner8.mp3 " , true) ;
PrecacheSound ( " misc/ctwinner9.mp3 " , true) ;
PrecacheSound ( " misc/ctwinner10.mp3 " , true) ;
PrecacheSound ( " misc/ctwinner11.mp3 " , true) ;
PrecacheSound ( " misc/ctwinner12.mp3 " , true) ;
PrecacheSound ( " misc/twinner1.mp3 " , true) ;
PrecacheSound ( " misc/twinner2.mp3 " , true) ;
PrecacheSound ( " misc/twinner3.mp3 " , true) ;
PrecacheSound ( " misc/twinner4.mp3 " , true) ;
PrecacheSound ( " misc/twinner5.mp3 " , true) ;
PrecacheSound ( " misc/twinner6.mp3 " , true) ;
PrecacheSound ( " misc/twinner7.mp3 " , true) ;
PrecacheSound ( " misc/twinner8.mp3 " , true) ;
PrecacheSound ( " misc/twinner9.mp3 " , true) ;
PrecacheSound ( " misc/twinner10.mp3 " , true) ;
PrecacheSound ( " misc/twinner11.mp3 " , true) ;
PrecacheSound ( " misc/twinner12.mp3 " , true) ;
}
else {
LogError ( "Not all sound files exists . " ) ;
LogError ( " Unload the Plugin . " ) ;
ServerCommand ( "sm plugins unload \ " RoundSound smx + + \ " ." ) ;
}
}

public OnConfigsExecuted ( ) {
if ( GetConVarBool ( g_hEnabled )) {
g_bEnabled = true ;
}
else if ( ! GetConVarBool ( g_hEnabled ) ) {
g_bEnabled = false ;
}
else {
g_bEnabled = true ;
LogError ( " False value continued plugin " ) ;
}
}

public CVarEnabled (Handle : convar , const String : oldValue [ ] , const String : newValue [ ] ) {
if ( GetConVarBool ( g_hEnabled )) {
g_bEnabled = true ;
}
else if ( ! GetConVarBool ( g_hEnabled ) ) {
g_bEnabled = false ;
}
else {
g_bEnabled = true ;
LogError ( " False value continued plugin " ) ;
}
}

public EventRoundEnd (Handle : event , const String : name [ ] , bool : dontBroadcast ) {
rnd_sound GetRandomInt = new ( 1 , 12 ) ;
new ev_winner GetEventInt = (event , " winner" ) ;
if ( g_bEnabled ) {
if ( ev_winner == 2 ) {
if ( rnd_sound == 1 ) {
EmitSoundToAll ( " misc/twinner1.mp3 ");
}
else if ( rnd_sound == 2 ) {
EmitSoundToAll ( " misc/twinner2.mp3 ");
}
else if ( rnd_sound == 3 ) {
EmitSoundToAll ( " misc/twinner3.mp3 ");
}
else if ( rnd_sound == 4 ) {
EmitSoundToAll ( " misc/twinner4.mp3 ");
}
else if ( rnd_sound == 5 ) {
EmitSoundToAll ( " misc/twinner5.mp3 ");
}
else if ( rnd_sound == 6 ) {
EmitSoundToAll ( " misc/twinner6.mp3 ");
}
else if ( rnd_sound == 7 ) {
EmitSoundToAll ( " misc/twinner7.mp3 ");
}
else if ( rnd_sound == 8 ) {
EmitSoundToAll ( " misc/twinner8.mp3 ");
}
else if ( rnd_sound == 9 ) {
EmitSoundToAll ( " misc/twinner9.mp3 ");
}
else if ( rnd_sound == 10 ) {
EmitSoundToAll ( " misc/twinner10.mp3 ");
}
else if ( rnd_sound == 11 ) {
EmitSoundToAll ( " misc/twinner11.mp3 ");
}
else if ( rnd_sound == 12 ) {
EmitSoundToAll ( " misc/twinner12.mp3 ");
}
else {
LogError ( " Sound CVar Ramdom Error . " ) ;
}
}
else if ( ev_winner == 3 ) {
if ( rnd_sound == 1 ) {
EmitSoundToAll ( " misc/ctwinner1.mp3 ");
}
else if ( rnd_sound == 2 ) {
EmitSoundToAll ( " misc/ctwinner2.mp3 ");
}
else if ( rnd_sound == 3 ) {
EmitSoundToAll ( " misc/ctwinner3.mp3 ");
}
else if ( rnd_sound == 4 ) {
EmitSoundToAll ( " misc/ctwinner4.mp3 ");
}
else if ( rnd_sound == 5 ) {
EmitSoundToAll ( " misc/ctwinner5.mp3 ");
}
else if ( rnd_sound == 6 ) {
EmitSoundToAll ( " misc/ctwinner6.mp3 ");
}
else if ( rnd_sound == 7 ) {
EmitSoundToAll ( " misc/ctwinner7.mp3 ");
}
else if ( rnd_sound == 8 ) {
EmitSoundToAll ( " misc/ctwinner8.mp3 ");
}
else if ( rnd_sound == 9 ) {
EmitSoundToAll ( " misc/ctwinner9.mp3 ");
}
else if ( rnd_sound == 10 ) {
EmitSoundToAll ( " misc/ctwinner10.mp3 ");
}
else if ( rnd_sound == 11 ) {
EmitSoundToAll ( " misc/ctwinner11.mp3 ");
}
else if ( rnd_sound == 12 ) {
EmitSoundToAll ( " misc/ctwinner12.mp3 ");
}
else {
LogError ( " Sound CVar Ramdom Error . " ) ;
}
}
else {
LogError ("No team has win the round . " ) ;
}
}
}

Can help me?

Thanks

Last edited by Shark_css; 01-06-2014 at 14:06.
Shark_css is offline
The Nameless One
Junior Member
Join Date: Apr 2014
Location: Nicosia, Cyprus
Old 04-18-2014 , 17:09   Re: [CSS]RoundSound++
Reply With Quote #104

Can I add my custom sounds?
The Nameless One is offline
Send a message via Skype™ to The Nameless One
The Nameless One
Junior Member
Join Date: Apr 2014
Location: Nicosia, Cyprus
Old 04-19-2014 , 12:11   Re: [CSS]RoundSound++
Reply With Quote #105

Quote:
Originally Posted by NAT View Post
noPASARAN
all:
Code:
decl String:tewin_snd1[MAX_FILE_LEN];
Format(tewin_snd1, sizeof(tewin_snd1), "sound/misc/twinnar.wav");
AddFileToDownloadsTable(tewin_snd1);
PrecacheSound()
cut in OnMapStart()

Code:
/* *
 * ANTiCHRiST RoundSound++ 
 * -------------------------
 * Changelog
 *   changelog.txt
 * Readme
 *   readme.txt
 * Credits
 *   Old CS 1.6 Plugin
 *   by "PaintLancer"
 * -------------------------
 * by TanaToS aka ANTiCHRiST
 */
#include <sourcemod>
#include <sdktools>
#include <sdktools_sound>
#include <console>
#include <string>

#pragma semicolon 1

#define PLUGIN_VERSION "1.0.1"
#define MAX_FILE_LEN 256

new Handle:g_hEnabled = INVALID_HANDLE;
new bool:g_bEnabled = true;

public Plugin:myinfo = {
    name = "RoundSound++",
    author = "ANTiCHRiST",
    description = "Plays a Sound at RoundEnd.",
    version = PLUGIN_VERSION,
    url = "http://passionfighters.de"
};

public OnPluginStart() {
    CreateConVar("sm_roundsound_version", PLUGIN_VERSION, "RoundSound++ version.", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    g_hEnabled = CreateConVar("sm_roundsound_enable", "1", "RoundSound++ Enable/Disable CVar.", FCVAR_PLUGIN|FCVAR_NOTIFY);

    HookEvent("round_end", EventRoundEnd);
    HookConVarChange(g_hEnabled, CVarEnabled);
}

public OnMapStart()
{
    decl String:tewin_snd1[MAX_FILE_LEN];
    decl String:tewin_snd2[MAX_FILE_LEN];
    decl String:tewin_snd3[MAX_FILE_LEN];
    decl String:ctwin_snd1[MAX_FILE_LEN];
    decl String:ctwin_snd2[MAX_FILE_LEN];
    decl String:ctwin_snd3[MAX_FILE_LEN];

    Format(tewin_snd1, sizeof(tewin_snd1), "sound/misc/twinnar.wav");
    Format(tewin_snd2, sizeof(tewin_snd2), "sound/misc/twinnar2.wav");
    Format(tewin_snd3, sizeof(tewin_snd3), "sound/misc/twinnar3.wav");
    Format(ctwin_snd1, sizeof(ctwin_snd1), "sound/misc/ctwinnar2.wav");
    Format(ctwin_snd2, sizeof(ctwin_snd2), "sound/misc/ctwinnar3.wav");
    Format(ctwin_snd3, sizeof(ctwin_snd3), "sound/misc/ctwinnar4.wav");

    if(FileExists(tewin_snd1) && FileExists(tewin_snd2) && FileExists(tewin_snd3) && FileExists(ctwin_snd1) && FileExists(ctwin_snd2) && FileExists(ctwin_snd3)) {
        AddFileToDownloadsTable(tewin_snd1);
        AddFileToDownloadsTable(tewin_snd2);
        AddFileToDownloadsTable(tewin_snd3);
        AddFileToDownloadsTable(ctwin_snd1);
        AddFileToDownloadsTable(ctwin_snd2);
        AddFileToDownloadsTable(ctwin_snd3);

        PrecacheSound("misc/ctwinnar2.wav", true);
        PrecacheSound("misc/ctwinnar3.wav", true);
        PrecacheSound("misc/ctwinnar4.wav", true);
        PrecacheSound("misc/twinnar.wav", true);
        PrecacheSound("misc/twinnar2.wav", true);
        PrecacheSound("misc/twinnar3.wav", true);
    }
    else {
        LogError("Not all sound files exists.");
        LogError("Unload the Plugin.");
        ServerCommand("sm plugins unload \"RoundSound++.smx\"");
    }
}

public OnConfigsExecuted() {
    if(GetConVarBool(g_hEnabled)) {
        g_bEnabled = true;
    }
    else if(!GetConVarBool(g_hEnabled)) {
        g_bEnabled = false;
    }
    else {
        g_bEnabled = true;
        LogError("False value plugin continued");
    }
}

public CVarEnabled(Handle:convar, const String:oldValue[], const String:newValue[]) {
    if(GetConVarBool(g_hEnabled)) {
        g_bEnabled = true;
    }
    else if(!GetConVarBool(g_hEnabled)) {
        g_bEnabled = false;
    }
    else {
        g_bEnabled = true;
        LogError("False value plugin continued");
    }
}

public EventRoundEnd(Handle:event, const String:name[], bool:dontBroadcast) {
    new rnd_sound = GetRandomInt(1, 3);
    new ev_winner = GetEventInt(event, "winner");
    if(g_bEnabled) {
        if(ev_winner == 2) {
            if(rnd_sound == 1) {
                EmitSoundToAll("misc/twinnar.wav");
            }
            else if(rnd_sound == 2) {
                EmitSoundToAll("misc/twinnar2.wav");
            }
            else if(rnd_sound == 3) {
                EmitSoundToAll("misc/twinnar3.wav");
            }
            else {
                LogError("Ramdom Sound CVar Error.");
            }
        }
        else if(ev_winner == 3) {
            if(rnd_sound == 1) {
                EmitSoundToAll("misc/ctwinnar2.wav");
            }
            else if(rnd_sound == 2) {
                EmitSoundToAll("misc/ctwinnar3.wav");
            }
            else if(rnd_sound == 3) {
                EmitSoundToAll("misc/ctwinnar4.wav");
            }
            else {
                LogError("Ramdom Sound CVar Error.");
            }
        }
        else {
            LogError("No team has win the round.");
        }
    }
}
Thq
The Nameless One is offline
Send a message via Skype™ to The Nameless One
The Nameless One
Junior Member
Join Date: Apr 2014
Location: Nicosia, Cyprus
Old 04-19-2014 , 12:53   Re: [CSS]RoundSound++
Reply With Quote #106

Another error occured says

*** Invalid sample rate (48000) for sound 'misc\twinnar7.mp3'.

Quote:
Originally Posted by Shit on shoe View Post
This is not a Error

read :L 06/02/2011 - 13:26:47: [RoundSound++.smx] Not all sound files exists.

You read what i written on my post ? Its must be 10 sounds for ct and t !
Dont forget rename your mp3 like my example in your sound folder:
Code:
ctwinnar.mp3
ctwinnar2.mp3
ctwinnar3.mp3
ctwinnar4.mp3
ctwinnar5.mp3
ctwinnar6.mp3
ctwinnar7.mp3
ctwinnar8.mp3
ctwinnar9.mp3
ctwinnar10.mp3

twinnar.mp3
twinnar2.mp3
twinnar3.mp3
twinnar4.mp3
twinnar5.mp3
.
.
.
.
twinnar10.mp3
The Nameless One is offline
Send a message via Skype™ to The Nameless One
Chaya_
BANNED
Join Date: Jul 2014
Location: Germany
Old 10-31-2014 , 15:39   Re: [CSS]RoundSound++
Reply With Quote #107

Fixxed a letter bug and change some Codes !!!

There is a new query sequence...

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdktools_sound>
#include <console>
#include <string>

#pragma semicolon 1

#define PLUGIN_VERSION "2.0.0 Beta"
#define MAX_FILE_LEN 512

new Handle:g_hEnabled INVALID_HANDLE;
new 
bool:g_bEnabled true;

public 
Plugin:myinfo = {
    
name "RoundSound++",
    
author "Chaya_",
    
description "Plays a Sound at RoundEnd.",
    
version PLUGIN_VERSION,
    
url "http://www.god-network.net"
};

public 
OnPluginStart() {
    
CreateConVar("sm_roundsound_version"PLUGIN_VERSION"RoundSound++ version."FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
g_hEnabled CreateConVar("sm_roundsound_enable""1""RoundSound++ Enable/Disable CVar."FCVAR_PLUGIN|FCVAR_NOTIFY);

    
HookEvent("round_end"EventRoundEnd);
    
HookConVarChange(g_hEnabledCVarEnabled);
}

public 
OnMapStart()
{
    
//CT Winner
    
decl String:ctwin_snd1[MAX_FILE_LEN];
    
decl String:ctwin_snd2[MAX_FILE_LEN];
    
decl String:ctwin_snd3[MAX_FILE_LEN];
    
decl String:ctwin_snd4[MAX_FILE_LEN];
    
//TE Winner
    
decl String:tewin_snd1[MAX_FILE_LEN];
    
decl String:tewin_snd2[MAX_FILE_LEN];
    
decl String:tewin_snd3[MAX_FILE_LEN];
    
decl String:tewin_snd4[MAX_FILE_LEN];

    
//CT Winner
    
Format(ctwin_snd1sizeof(ctwin_snd1), "sound/misc/ctwinner1.wav");
    
Format(ctwin_snd2sizeof(ctwin_snd2), "sound/misc/ctwinner2.wav");
    
Format(ctwin_snd3sizeof(ctwin_snd3), "sound/misc/ctwinner3.wav");
    
Format(ctwin_snd4sizeof(ctwin_snd4), "sound/misc/ctwinner4.wav");
    
//TE Winner
    
Format(tewin_snd1sizeof(tewin_snd1), "sound/misc/tewinner1.wav");
    
Format(tewin_snd2sizeof(tewin_snd2), "sound/misc/tewinner2.wav");
    
Format(tewin_snd3sizeof(tewin_snd3), "sound/misc/tewinner3.wav");
    
Format(tewin_snd4sizeof(tewin_snd4), "sound/misc/tewinner4.wav");

    if(
FileExists(ctwin_snd1) && FileExists(ctwin_snd2) && FileExists(ctwin_snd3) && FileExists(ctwin_snd4) && FileExists(tewin_snd1) && FileExists(tewin_snd2) && FileExists(tewin_snd3) && FileExists(tewin_snd4)) {
        
//CT Winner
        
AddFileToDownloadsTable(ctwin_snd1);
        
AddFileToDownloadsTable(ctwin_snd2);
        
AddFileToDownloadsTable(ctwin_snd3);
        
AddFileToDownloadsTable(ctwin_snd4);
        
        
//TE Winner
        
AddFileToDownloadsTable(tewin_snd1);
        
AddFileToDownloadsTable(tewin_snd2);
        
AddFileToDownloadsTable(tewin_snd3);
        
AddFileToDownloadsTable(tewin_snd4);



        
PrecacheSound("misc/ctwinner1.wav"true);
        
PrecacheSound("misc/ctwinner2.wav"true);
        
PrecacheSound("misc/ctwinner3.wav"true);
        
PrecacheSound("misc/ctwinner4.wav"true);
        
PrecacheSound("misc/tewinner1.wav"true);
        
PrecacheSound("misc/tewinner2.wav"true);
        
PrecacheSound("misc/tewinner3.wav"true);
        
PrecacheSound("misc/tewinner4.wav"true);
    }
    else {
        
LogError("Not all sound files exists.");
        
LogError("Unload the Plugin.");
        
ServerCommand("sm plugins unload \"RoundSound++.smx\"");
    }
}

public 
OnConfigsExecuted() {
    if(
GetConVarBool(g_hEnabled)) {
        
g_bEnabled true;
    }
    else if(!
GetConVarBool(g_hEnabled)) {
        
g_bEnabled false;
    }
    else {
        
g_bEnabled true;
        
LogError("False value plugin continued");
    }
}

public 
CVarEnabled(Handle:convar, const String:oldValue[], const String:newValue[]) {
    if(
GetConVarBool(g_hEnabled)) {
        
g_bEnabled true;
    }
    else if(!
GetConVarBool(g_hEnabled)) {
        
g_bEnabled false;
    }
    else {
        
g_bEnabled true;
        
LogError("False value plugin continued");
    }
}

public 
EventRoundEnd(Handle:event, const String:name[], bool:dontBroadcast) {
    new 
rnd_sound GetRandomInt(14);
    new 
ev_winner GetEventInt(event"winner");
    if(
g_bEnabled) {
        if(
ev_winner == 2) {
            if(
rnd_sound == 1) {
                
EmitSoundToAll("misc/ctwinner1.wav");
            }
            else if(
rnd_sound == 2) {
                
EmitSoundToAll("misc/ctwinner2.wav");
            }
            else if(
rnd_sound == 3) {
                
EmitSoundToAll("misc/ctwinner3.wav");
            }
            else if(
rnd_sound == 4) {
                
EmitSoundToAll("misc/ctwinner4.wav");
            }
            else {
                
LogError("Ramdom Sound CVar Error.");
            }
        }
        else if(
ev_winner == 3) {
            if(
rnd_sound == 1) {
                
EmitSoundToAll("misc/tewinner1.wav");
            }
            else if(
rnd_sound == 2) {
                
EmitSoundToAll("misc/tewinner2.wav");
            }
            else if(
rnd_sound == 3) {
                
EmitSoundToAll("misc/tewinner3.wav");
            }
            else if(
rnd_sound == 4) {
                
EmitSoundToAll("misc/tewinner4.wav");
            }
            else {
                
LogError("Ramdom Sound CVar Error.");
            }
        }
        else {
            
LogError("No team has win the round.");
        }
    }

Chaya_ is offline
Send a message via ICQ to Chaya_ Send a message via Skype™ to Chaya_
Reply


Thread Tools
Display Modes

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 22:19.


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