Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define PREFIX "bombs"
- #include <amxmodx>
- enum _:enMusicData
- {
- Name[ 32 ],
- Location[ 64 ]
- }
- new szMusic[ ][ enMusicData ] =
- {
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" },
- { "*PUT_HERE_SONG_NAME*", "*PUT_HERE_MP3_LOCATION.mp3*" }
- }
- new iVolume[ 33 ], iMusic[ 33 ];
- new szText[ 128 ];
- public plugin_init()
- {
- register_plugin( "Music Menu", "1.0", "@.TheBomB`" )
- register_clcmd( "say /music", "MusicCmd" )
- }
- public plugin_precache()
- {
- for ( new i; i < sizeof szMusic; i++ )
- precache_sound( szMusic[ i ][ Location ] )
- }
- public client_putinserver( client )
- {
- client_cmd( client, "MP3Volume ^"1.0^"" );
- iMusic[ client ] = -1
- }
- public MusicCmd( client )
- {
- formatex( szText, charsmax( szText ), "\r[AMXX]\w Music Menu" )
- new menu = menu_create( szText, "music_handler" )
- if( iMusic[ client ] == -1 )
- formatex( szText, charsmax( szText ), "Song: \rNo Song Choosen^n^n\wVolume: \y%i%", iVolume[ client ] * 10 )
- else
- formatex( szText, charsmax( szText ), "Song: \y%s^n^n\wVolume: \y%i%s", szMusic[ iMusic[ client ] ][ Name ] ,iVolume[ client ], iVolume[ client ] == 0 ? "%" : "0%" )
- menu_additem( menu, szText )
- menu_additem( menu, "Volume Up" )
- menu_additem( menu, "Volume Down^n" )
- menu_additem( menu, "Start Song^n" )
- menu_display( client, menu )
- return PLUGIN_HANDLED;
- }
- public music_handler( client, menu, item )
- {
- if( item == MENU_EXIT )
- return menu_destroy( menu )
- switch( item )
- {
- case 0:
- return SongsList( client )
- case 1:
- {
- if( iVolume[ client ] != 10 )
- {
- iVolume[ client ]++;
- Volume( client );
- }
- return MusicCmd( client )
- }
- case 2:
- {
- if ( iVolume[ client ] != 0 )
- {
- iVolume[ client ]--;
- Volume( client );
- }
- return MusicCmd( client );
- }
- case 3:
- {
- if( iMusic[ client ] == -1 )
- {
- ColorChat( client, "You have to choose a song" )
- return MusicCmd( client )
- }
- client_cmd( client, "mp3 play ^"sound/%s^"", szMusic[ iMusic[ item ] ][ Location ] );
- return ColorChat( client, "You have start the song ^4%s^1. volume:^4 %i%% ", szMusic[ iMusic[ client ] ][ Name ] ,iVolume[ client ] * 10 )
- }
- }
- return 0;
- }
- public SongsList( client )
- {
- formatex( szText, charsmax( szText ), "\r[AMXX]\w Music Menu | Songs List" )
- new menu = menu_create( szText, "songlist_handler" )
- for( new i; i < sizeof szMusic; i++ )
- {
- formatex( szText, charsmax( szText ), "%s", szMusic[ i ][ Name ] )
- menu_additem( menu, szText )
- }
- menu_display( client, menu, 0 )
- return 0;
- }
- public songlist_handler( client, menu, item )
- {
- if( item == MENU_EXIT )
- {
- menu_destroy( menu )
- return MusicCmd( client )
- }
- iMusic[ client ] = item;
- return MusicCmd( client )
- }
- stock Volume( client )
- {
- client_cmd( client, "MP3Volume ^"%.1f^"", iVolume[ client ] / 10 );
- }
- stock ColorChat( const index, const string[], any:... )
- {
- new szMsg[ 191 ], Players[ 32 ], PNum = 1;
- static iLen; iLen = formatex( szMsg, charsmax( szMsg ), "^3[AMXX]^1 " );
- vformat( szMsg[ iLen ], charsmax( szMsg ) - iLen, string, 3 );
- if ( index )
- Players[ 0 ] = index;
- else
- get_players( Players, PNum, "ch" );
- for ( new i; i < PNum; i++ )
- {
- if( is_user_connected( Players[ i ] ) )
- {
- message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, Players[ i ] );
- write_byte( Players[ i ] );
- write_string( szMsg );
- message_end( );
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement