Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**************************************************************
- 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.2",
- 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 ) )
- {
- new i = random ( sizeof ( g_te_win_sounds ) );
- PlaySoundToClients ( g_te_win_sounds [ i ] );
- return 1;
- }
- else if ( equal ( audiocode [ 7 ], "ctwin" ) )
- {
- new i = random ( sizeof ( g_ct_win_sounds ) );
- PlaySoundToClients ( g_ct_win_sounds [ i ] );
- return 1;
- }
- 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 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement