Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <colorchat>
- #define HEB_SOUNDS 12 // כמה שירים בעברית
- #define ENG_SOUNDS 12 // כמה שירים באנגלית
- #define MaxPlayers get_maxplayers()
- new Prefix[] = "Fun"
- new Text[ 200 ]
- new Song[ 200 ]
- new Plugin[] = "Music Menu"
- new Version[] = "4.0"
- new Author[] = "ISRaiyaN"
- new iVolume[ 200 ];
- new bool:PlayForAll[ 200 ]
- new bool:BlockAdminPlay[ 200 ]
- enum _: Heb
- {
- NamesMusic[ 200 ],
- Singer[ 200 ],
- Play[ 200 ],
- Time[ 200 ]
- }
- enum _: Eng
- {
- NamesMusic[ 200 ],
- Singer[ 200 ],
- Play[ 200 ],
- Time[ 200 ]
- }
- new const HebMusic[ HEB_SOUNDS ][ Heb ] =
- {
- { "Heb Songs Name", "Music/Hebrew/SongsName.mp3" },
- { "Heb Songs Name", "Music/Hebrew/SongsName.mp3" },
- { "Heb Songs Name", "Music/Hebrew/SongsName.mp3" },
- { "Heb Songs Name", "Music/Hebrew/SongsName.mp3" },
- { "Heb Songs Name", "Music/Hebrew/SongsName.mp3" },
- { "Heb Songs Name", "Music/Hebrew/SongsName.mp3" },
- { "Heb Songs Name", "Music/Hebrew/SongsName.mp3" },
- { "Heb Songs Name", "Music/Hebrew/SongsName.mp3" },
- { "Heb Songs Name", "Music/Hebrew/SongsName.mp3" },
- { "Heb Songs Name", "Music/Hebrew/SongsName.mp3" },
- { "Heb Songs Name", "Music/Hebrew/SongsName.mp3" },
- { "Heb Songs Name", "Music/Hebrew/SongsName.mp3" }
- }
- new const EngMusic[ ENG_SOUNDS ][ Eng ] =
- {
- { "Eng Songs Name", "Music/English/SongsName.mp3" },
- { "Eng Songs Name", "Music/English/SongsName.mp3" },
- { "Eng Songs Name", "Music/English/SongsName.mp3" },
- { "Eng Songs Name", "Music/English/SongsName.mp3" },
- { "Eng Songs Name", "Music/English/SongsName.mp3" },
- { "Eng Songs Name", "Music/English/SongsName.mp3" },
- { "Eng Songs Name", "Music/English/SongsName.mp3" },
- { "Eng Songs Name", "Music/English/SongsName.mp3" },
- { "Eng Songs Name", "Music/English/SongsName.mp3" },
- { "Eng Songs Name", "Music/English/SongsName.mp3" },
- { "Eng Songs Name", "Music/English/SongsName.mp3" },
- { "Eng Songs Name", "Music/English/SongsName.mp3" }
- }
- public plugin_precache()
- {
- for( new i; i < ENG_SOUNDS; i++ )
- precache_sound( EngMusic[ i ][ Play ] )
- for( new i; i < HEB_SOUNDS; i++ )
- precache_sound( HebMusic[ i ][ Play ] )
- }
- public plugin_init() {
- register_plugin( Plugin, Version, Author)
- register_clcmd("say /music", "MusicMenu")
- register_clcmd("say /sm", "StopMusic")
- register_clcmd("say /stop", "StopMusic")
- register_clcmd("say /stopmusic", "StopMusic")
- }
- public client_putinserver( id )
- {
- client_cmd( id, "MP3Volume ^"1.0^"" );
- Song[ id ] = 0;
- iVolume[id] = 100
- PlayForAll[id] = false
- BlockAdminPlay[id] = true
- }
- public StopMusic(id)
- {
- client_cmd(id, "mp3 stop")
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1You have ^3Stopped ^1your ^4Music.", Prefix )
- return 1;
- }
- public MusicMenu(id)
- {
- formatex( Text, charsmax( Text ), "\r[ \d%s \r] \yMusic Menu \dBy \w%s^n^n\r- \dPlaying For: %s^n\r- \dBlock Admin: %s^n\r- \dVolume: \y%d%", Prefix, Author,
- PlayForAll[id] ? "\yAll Players" : "\rYourself", BlockAdminPlay[id] ? "\yEnabled" : "\rDisabled", iVolume[id])
- new MMenu = menu_create( Text, "Music_Handler")
- menu_additem( MMenu, "English Music \rMenu" )
- menu_additem( MMenu, "Hebrew Music \rMenu^n" )
- menu_additem( MMenu, "Stop \yMusic^n" )
- menu_additem( MMenu, "Volume \rMenu^n" )
- menu_additem( MMenu, "Random \yEnglish Music" )
- menu_additem( MMenu, "Random \yHebrew Music^n" )
- menu_additem( MMenu, "Block Admin Music^n\r- \dit blocks when admin play music^n\r- \dfor all players on the server^n" )
- if( (get_user_flags(id) & ADMIN_KICK) )
- {
- menu_additem( MMenu, "Playing For: \yAll Players\r/\yYourself^n^n" )
- menu_additem( MMenu, "\yExit" )
- }
- menu_setprop(MMenu, MPROP_EXIT, MEXIT_ALL )
- if( (get_user_flags(id) & ADMIN_KICK) )
- {
- menu_setprop(MMenu, MPROP_PERPAGE, 0 )
- }
- menu_setprop(MMenu, MPROP_EXITNAME, "\yExit")
- menu_setprop(MMenu, MPROP_NUMBER_COLOR, "\r" )
- menu_display(id, MMenu, 0);
- return 1;
- }
- public Music_Handler(id, MMenu, item)
- {
- switch( item )
- {
- case 0:
- {
- EngMusicMenu(id)
- }
- case 1:
- {
- HebMusicMenu(id)
- }
- case 2:
- {
- client_cmd(id, "mp3 stop")
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1You have ^3Stopped ^1your ^4Music.", Prefix )
- MusicMenu(id)
- }
- case 3:
- {
- VolumeMenu(id)
- }
- case 6:
- {
- BlockAdminPlay[id] = !BlockAdminPlay[id]
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1You have ^3%s ^1block admin music.", Prefix, BlockAdminPlay[id] ? "Enabled" : "Disabled" )
- MusicMenu(id)
- }
- case 4:
- {
- new RandomEng = random_num( 1, ENG_SOUNDS )
- client_cmd(id, "mp3 play ^"sound/%s^"", EngMusic[ RandomEng ][ Play ] )
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1You have ^3Received ^1the ^4Song: ^3%s", Prefix, EngMusic[ RandomEng ][ NamesMusic ])
- MusicMenu(id)
- }
- case 5:
- {
- new RandomHeb = random_num( 1, HEB_SOUNDS )
- client_cmd(id, "mp3 play ^"sound/%s^"", HebMusic[ RandomHeb ][ Play ] )
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1You have ^3Received ^1the ^4Song: ^3%s", Prefix, HebMusic[ RandomHeb ][ NamesMusic ])
- MusicMenu(id)
- }
- case 7:
- {
- PlayForAll[id] = !PlayForAll[id]
- MusicMenu(id)
- }
- }
- }
- public EngMusicMenu(id)
- {
- formatex( Text, charsmax( Text ), "\r[ \d%s \r] \yEnglish Music Menu", Prefix)
- new EngMenu = menu_create( Text, "Eng_Handler")
- for( new i; i < sizeof EngMusic; i++ )
- {
- formatex( Text, charsmax( Text ), "\w%s", EngMusic[ i ][ NamesMusic ] )
- menu_additem( EngMenu, Text )
- }
- menu_setprop(EngMenu, MPROP_EXIT, MEXIT_ALL );
- menu_setprop(EngMenu, MPROP_EXITNAME, "\yBack To Music Menu" )
- menu_setprop(EngMenu, MPROP_NUMBER_COLOR, "\r" )
- menu_display(id, EngMenu, 0);
- return ;
- }
- public Eng_Handler(id, EngMenu, item)
- {
- if ( item == MENU_EXIT )
- {
- menu_destroy( EngMenu );
- MusicMenu( id );
- }
- Song[ id ] = item
- EngSongInfo(id, item)
- }
- public HebMusicMenu(id)
- {
- formatex( Text, charsmax( Text ), "\r[ \d%s \r] \yHebrew Music Menu", Prefix)
- new HebMenu = menu_create( Text, "Heb_Handler")
- for( new i; i < sizeof HebMusic; i++ )
- {
- formatex( Text, charsmax( Text ), "\w%s", HebMusic[ i ][ NamesMusic ] )
- menu_additem( HebMenu, Text )
- }
- menu_setprop(HebMenu, MPROP_EXIT, MEXIT_ALL );
- menu_setprop(HebMenu, MPROP_EXITNAME, "\yBack To Music Menu" )
- menu_setprop(HebMenu, MPROP_NUMBER_COLOR, "\r" )
- menu_display(id, HebMenu, 0);
- return ;
- }
- public Heb_Handler(id, HebMenu, item)
- {
- if ( item == MENU_EXIT )
- {
- menu_destroy( HebMenu );
- MusicMenu( id );
- }
- Song[ id ] = item
- HebSongInfo(id, item)
- }
- public VolumeMenu(id)
- {
- formatex( Text, charsmax( Text ), "\r[ \d%s \r] \yVolume Menu^n\y- \dChoose Your Volume You Want^n\dVolume: \y%d%", Prefix, iVolume[id])
- new VolMenu = menu_create( Text, "Volume_Handler")
- menu_additem( VolMenu, "Volume: \y100%" )
- menu_additem( VolMenu, "Volume: \y80%" )
- menu_additem( VolMenu, "Volume: \y60%" )
- menu_additem( VolMenu, "Volume: \y40%" )
- menu_additem( VolMenu, "Volume: \y20%" )
- menu_additem( VolMenu, "Volume: \y0%" )
- menu_setprop(VolMenu, MPROP_EXIT, MEXIT_ALL );
- menu_setprop(VolMenu, MPROP_EXITNAME, "\yBack" )
- menu_setprop(VolMenu, MPROP_NUMBER_COLOR, "\r" )
- menu_display(id, VolMenu, 0);
- return ;
- }
- public Volume_Handler(id, VolMenu, item)
- {
- if ( item == MENU_EXIT )
- {
- menu_destroy( VolMenu );
- MusicMenu( id );
- }
- switch( item )
- {
- case 0:
- {
- iVolume[id] = 100
- client_cmd(id, "MP3Volume ^"1.0^"" )
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1Your ^3Volume ^1now:^4 100% ^1( ^3Max Volume ^1)", Prefix )
- VolumeMenu(id)
- }
- case 1:
- {
- iVolume[id] = 80
- client_cmd(id, "MP3Volume ^"0.8^"" )
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1Your ^3Volume ^1now:^4 80%", Prefix )
- VolumeMenu(id)
- }
- case 2:
- {
- iVolume[id] = 60
- client_cmd(id, "MP3Volume ^"0.6^"" )
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1Your ^3Volume ^1now:^4 60%", Prefix )
- VolumeMenu(id)
- }
- case 3:
- {
- iVolume[id] = 40;
- client_cmd(id, "MP3Volume ^"0.4^"" )
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1Your ^3Volume ^1now:^4 40%", Prefix )
- VolumeMenu(id)
- }
- case 4:
- {
- iVolume[id] = 20;
- client_cmd(id, "MP3Volume ^"0.2^"" )
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1Your ^3Volume ^1now:^4 20%", Prefix )
- VolumeMenu(id)
- }
- case 5:
- {
- iVolume[id] = 0;
- client_cmd(id, "MP3Volume ^"0.0^"" )
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1Your ^3Volume ^1now:^4 0%", Prefix )
- VolumeMenu(id)
- }
- }
- }
- public HebSongInfo(id, item)
- {
- formatex( Text, charsmax( Text ), "\r[ \d%s \r] ^n\r- \dSong Info:^n\y-----------------^n\r- \dSong Name: \y%s^n\r- \dSinger Name: \y%s^n\r- \dSong Time: \y%s^n", Prefix, HebMusic[ item ][ NamesMusic ],HebMusic[ item ][ Singer ], HebMusic[ item ][ Time ])
- new HebMenu = menu_create( Text, "Heb_Info" )
- menu_additem( HebMenu, "\d- \rPlay Song \d-" )
- menu_setprop(HebMenu, MPROP_EXIT, MEXIT_ALL );
- menu_setprop(HebMenu, MPROP_EXITNAME, "\yBack" )
- menu_setprop(HebMenu, MPROP_NUMBER_COLOR, "\r" )
- menu_display( id, HebMenu, 0 )
- }
- public Heb_Info(id, HebMenu, item)
- {
- if ( item == MENU_EXIT )
- {
- menu_destroy( HebMenu )
- HebMusicMenu( id )
- }
- switch( item )
- {
- case 0:
- {
- if(! PlayForAll[id] )
- {
- client_cmd(id, "mp3 play ^"sound/%s^"", HebMusic[ Song[id]][ Play ] )
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1You have ^3Started ^1the ^4Song: ^3%s", Prefix, HebMusic[ Song[id]][ NamesMusic ])
- }
- for ( new i = 1; i < MaxPlayers; i++ )
- {
- if( PlayForAll[id] )
- if(! BlockAdminPlay[i] )
- {
- new AdminName[ 32 ];
- get_user_name( id, AdminName, charsmax( AdminName ) );
- client_cmd(id, "mp3 play ^"sound/%s^"", HebMusic[ Song[id]][ Play ] )
- client_cmd(i, "mp3 play ^"sound/%s^"", HebMusic[ Song[id]][ Play ] )
- ColorChat(i, RED, "^4[ ^3%s ^4] ^1ADMIN: ^3%s ^1Started the ^4Song: ^3%s", Prefix, AdminName, HebMusic[ Song[id]][ NamesMusic ])
- }
- else if( BlockAdminPlay[id] )
- {
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1You have play to all players the ^4Song: ^3%s", Prefix, HebMusic[ Song[id]][ NamesMusic ])
- }
- }
- }
- }
- menu_destroy( HebMenu )
- }
- public EngSongInfo(id, item)
- {
- formatex( Text, charsmax( Text ), "\r[ \d%s \r] ^n\r- \dSong Info:^n\y-----------------^n\r- \dSong Name: \y%s^n\r- \dSinger Name: \y%s^n\r- \dSong Time: \y%s^n", Prefix, EngMusic[ item ][ NamesMusic ],EngMusic[ item ][ Singer ], EngMusic[ item ][ Time ])
- new EngMenu = menu_create( Text, "Eng_Info" )
- menu_additem( EngMenu, "\d- \rPlay Song \d-" )
- menu_setprop(EngMenu, MPROP_EXIT, MEXIT_ALL );
- menu_setprop(EngMenu, MPROP_EXITNAME, "\yBack" )
- menu_setprop(EngMenu, MPROP_NUMBER_COLOR, "\r" )
- menu_display( id, EngMenu, 0 )
- }
- public Eng_Info(id, EngMenu, item)
- {
- if ( item == MENU_EXIT )
- {
- menu_destroy( EngMenu );
- EngMusicMenu( id );
- }
- switch( item )
- {
- case 0:
- {
- if(! PlayForAll[id] )
- {
- client_cmd(id, "mp3 play ^"sound/%s^"", EngMusic[ Song[id]][ Play ] )
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1You have ^3Started ^1the ^4Song: ^3%s", Prefix, EngMusic[ Song[id]][ NamesMusic ])
- }
- for ( new i = 1; i < MaxPlayers; i++ )
- {
- if( PlayForAll[id] )
- if(! BlockAdminPlay[i] )
- {
- new AdminName[ 32 ];
- get_user_name( id, AdminName, charsmax( AdminName ) );
- client_cmd(i, "mp3 play ^"sound/%s^"", EngMusic[ Song[id]][ Play ] )
- client_cmd(id, "mp3 play ^"sound/%s^"", EngMusic[ Song[id]][ Play ] )
- ColorChat(i, RED, "^4[ ^3%s ^4] ^1ADMIN: ^3%s ^1Started the ^4Song: ^3%s", Prefix, AdminName, EngMusic[ Song[id]][ NamesMusic ])
- }
- else if( BlockAdminPlay[id] )
- {
- ColorChat(id, RED, "^4[ ^3%s ^4] ^1You have play to all players the ^4Song: ^3%s", Prefix, EngMusic[ Song[id]][ NamesMusic ])
- }
- }
- }
- }
- menu_destroy( EngMenu )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement