Ok , deci :
Sma
Code: Select all
/**************************************************************
Round Sounds Advanced
(c) 2013 by CryWolf
www.eXtreamCS.com
www.amxmodx.org
Descriere: Acest plugin va ofera posibilitatea de a schimba sunetele
de la inceput de runda si cele de la sfarsit, este unic prin faptul ca ofera
suport pentru fisiere .wav si .mp3 iar sunetele de la inceput de runda inlocuiesc
sunetul radio de tip "go go go" si sunetele la sfarsit de runda Counter-Terrorist Win / Terrorist Win
cu cele din acest plugin :)
Credite:
- Askhanar functia de precache din FMU
- Cheap_suit pentru modalitatea de a inlocui sunetele radio cu o metoda mai avansata
- PaintLancer: Pentru ideea originala!
Changelog:
v1.0
- Prima versiune stabila
Licenta de tip GNU (Open Source)
Adica, aveti voie sa modificati continutul dar nu si Autorul
This file is part of AMX Mod X.
Round Sounds free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
RoundSounds is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this file. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************/
#include < amxmodx >
#include < amxmisc >
#tryinclude "round_sounds_advanced.cfg"
#pragma semicolon 1
//Plugin registration
new const
PLUGIN_NAME [ ] = "Round Sounds Advanced",
PLUGIN_VERSION [ ] = "1.0",
PLUGIN_AUTHOR [ ] = "CryWolf";
// pCvar Pointers
new pCvar_endsound, pCvar_beginsound, g_radiofix;
public plugin_precache ( )
{
pCvar_beginsound = register_cvar ( "amxx_bsounds", "1" );
pCvar_endsound = register_cvar ( "amxx_esounds", "1" );
new i, path [ 128 ];
if ( get_pcvar_num ( pCvar_beginsound ) )
{
for ( i = 0; i < sizeof g_begun_sounds; i++ )
{
if ( contain ( g_begun_sounds [ i ], ".wav" ) > 0 ) {
precache_sound ( g_begun_sounds [ i ] );
}
else if ( contain ( g_begun_sounds [ i ], ".mp3" ) > 0 ) {
formatex ( path, charsmax ( path ), "sound/%s", g_begun_sounds [ i ]);
precache_generic ( path );
}
}
}
if ( get_pcvar_num ( pCvar_endsound ) )
{
for ( i = 0; i < sizeof g_ct_win_sounds; i++ )
{
if ( contain ( g_ct_win_sounds [ i ], ".wav" ) > 0 ) {
precache_sound ( g_ct_win_sounds [ i ] );
}
else if ( contain ( g_ct_win_sounds [ i ], ".mp3" ) > 0 ) {
formatex ( path, charsmax ( path ), "sound/%s", g_ct_win_sounds [ i ] );
precache_generic ( path );
}
}
for ( i = 0; i < sizeof g_te_win_sounds; i++ )
{
if ( contain ( g_te_win_sounds [ i ], ".wav" ) > 0 ) {
precache_sound ( g_te_win_sounds [ i ] );
}
else if ( contain ( g_te_win_sounds [ i ], ".mp3" ) > 0 ) {
formatex ( path, charsmax ( path ), "sound/%s", g_te_win_sounds [ i ] );
precache_generic ( path );
}
}
}
}
public plugin_init ( )
{
register_plugin ( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
register_message ( get_user_msgid ( "SendAudio" ), "FunC_MSG_SendAudio" );
}
public FunC_MSG_SendAudio ( msgid, dest, id )
{
static audiocode [ 26 ];
get_msg_arg_string ( 2, audiocode, charsmax ( audiocode ) );
if( get_pcvar_num ( pCvar_beginsound ) )
{
if ( equal ( audiocode [ 7 ], "MOVEOUT" ) || equal ( audiocode [ 7 ], "LOCKNLOAD" )
|| equal ( audiocode [ 7 ], "LETSGO" ) || ( equal ( audiocode [ 7 ], "GO" ) && !g_radiofix ) )
{
set_msg_arg_string ( 2, "%!MRAD_ELIM" ), g_radiofix = false;
g_radiofix = false;
new i = random ( sizeof ( g_begun_sounds ) );
PlaySoundToClients ( g_begun_sounds [ i ] );
return 1;
}
}
if ( equal ( audiocode [ 7 ], "terwin" ) && get_pcvar_num ( pCvar_endsound ) ) {
set_msg_arg_string ( 2, "2&%!MRAD_terwin" );
new i = random ( sizeof ( g_te_win_sounds ) );
PlaySoundToClients ( g_te_win_sounds [ i ] );
}
else if ( equal ( audiocode [ 7 ], "ctwin" ) ) {
set_msg_arg_string ( 2, "2&%!MRAD_ctwin" );
new i = random ( sizeof ( g_ct_win_sounds ) );
PlaySoundToClients ( g_ct_win_sounds [ i ] );
}
return 0;
}
public cmd_fixradio ( ) {
g_radiofix = true;
}
PlaySoundToClients ( const sound [ ] )
{
if ( equal ( sound [ strlen ( sound ) -4 ], ".mp3" ) )
client_cmd ( 0, "mp3 play ^"sound/%s^"", sound );
else
client_cmd ( 0, "spk ^"%s^"", sound );
}
Cfg-ul
Code: Select all
/*
Round Sounds Advanced v1.0
by CryWolf
Info:
Pentru a adauga mai multe sunete adaugati o virgula dupa ultimele ghilimele
si adaugati mai departe gen:
new const g_begun_sounds [ ] [ ] =
{
"misc/ctt1.mp3",
"misc/ctt2.mp3",
"misc/ctt3.mp3",
"misc/ctt4.mp3",
"misc/ttt1.mp3",
"misc/ttt2.mp3",
"misc/ttt3.mp3",
"misc/ttt4.mp3"
};
ATENTIE! Ultimul rand nu trebuie sa aiba virgulita!
ATENTIE! Acest fisier trebuie sa fie in folderul "scripting" langa .sma-ul "round_sounds_advanced.sma" astfel pluginul nu se va compila!
*/
// Sunetele de la inceput de runda :)
// Format .MP3 si .WAV
new const g_begun_sounds [ ] [ ] =
{
"misc/ctt1.mp3",
"misc/ctt2.mp3"
};
// Sunetele cand echipa Counter-Terrorist este castigatoarea :)
// Format .MP3 si .WAV
new const g_ct_win_sounds [ ] [ ] =
{
"misc/ctt1.mp3",
"misc/ctt2.mp3",
"misc/ctt3.mp3",
"misc/ctt4.mp3"
};
// Sunetele cand echipa Terrorist este castigatoarea :)
// Format .MP3 si .WAV
new const g_te_win_sounds [ ] [ ] =
{
"misc/ttt1.mp3",
"misc/ttt2.mp3",
"misc/ttt3.mp3",
"misc/ttt4.mp3"
};
Le-am dat
Compiler , si a iesit
round_sounds_advanced
- Download Sma+Cfg
Aici
- Download Sunete
Aici
Problema este ca nu se aude , ceea ce ar trebui sa se auda , adica
Sunetele.