Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Formatright © 2012, TigeQ Aka CreePs
- *
- * Advanced Music Menu is free software;
- * This program is free for all players
- * This program has build in the hope to help for some players
- * You can published this program only with Formatright
- *
- * Thanks for reading my Formatright Enjoy this program
- *
- * Please do not change the credits thank you!
- *
- * (** if your name is "Noam" please delete this program **)
- * (** if your name is "Noam" dont change CREDITS **)
- * (** if your name is "Noam" GO FUCK YOUR SELF **)
- */
- #include <amxmodx>
- #define VERSION "1.0"
- #define ADMIN_ACCESS ADMIN_KICK
- #pragma semicolon 1
- enum // check the action(heb or eng) of the menu
- {
- ENG_MENU,
- HEB_MENU
- };
- new const cmdOpen[][] = // all cmds to open the music menu
- {
- "say /music",
- "say music",
- "say_team /music",
- "say_team music",
- "nightvision"
- };
- new const Eng_Songs_dir[][] = // put here all english songs ** NO NEEDED SOUND/ **
- {
- "Music/English/eng_song1.mp3",
- "Music/English/eng_song2.mp3",
- "Music/English/eng_song3.mp3"
- };
- new const Eng_Songs_name[][] = // put here all english songs names that will be in the menu
- {
- "Eng Song #1",
- "Eng Song #2",
- "Eng Song #3"
- };
- new const Heb_Songs_dir[][] = // put here all hebrew songs ** NO NEEDED SOUND/ **
- {
- "Music/Hebrew/heb_song1.mp3",
- "Music/Hebrew/heb_song2.mp3",
- "Music/Hebrew/heb_song3.mp3"
- };
- new const Heb_Songs_name[][] = // put here all hebrew songs names that will be in the menu
- {
- "Heb Song #1",
- "Heb Song #2",
- "Heb Song #3"
- };
- new menu_action[ 33 ];
- new play_for_all[ 33 ];
- new Float: Volume[ 33 ];
- public plugin_precache()
- {
- for( new i; i < sizeof Eng_Songs_dir; i++ )
- precache_sound( Eng_Songs_dir[ i ] );
- for( new i; i < sizeof Heb_Songs_dir; i++ )
- precache_sound( Heb_Songs_dir[ i ] );
- }
- public plugin_init() {
- register_plugin( "Advanced Music Menu", VERSION, "CreePs" );
- for( new i; i < sizeof cmdOpen; i++ )
- register_clcmd( cmdOpen[ i ], "cmdShowMenu" );
- }
- public client_putinserver( client )
- {
- if( get_user_flags( client ) & ADMIN_ACCESS )
- play_for_all[ client ] = true;
- else
- play_for_all[ client ] = false;
- Volume[ client ] = 0.5;
- }
- public cmdShowMenu( client )
- {
- static title[ 128 ], item[ 128 ];
- formatex( title, sizeof( title ) - 1, "\y[Music]\d Music Main Menu^n\wby CreePs" );
- new menu = menu_create( title, "caseMenu" );
- menu_additem( menu, "English Music", "1" );
- menu_additem( menu, "Hebrew Music", "2" );
- formatex( item, sizeof( item ) - 1, "Stop Music -\y for %s", play_for_all[ client ] ? "All" : "My Self" ) && menu_additem( menu, item, "3" );
- formatex( item, sizeof( item ) - 1, "Play For All Players -\y %s", play_for_all[ client ] ? "Yes" : "No" ) && menu_additem( menu, item, "4" );
- formatex( item, sizeof( item ) - 1, "Volume -\y %.1f", Volume[ client ] ) && menu_additem( menu, item, "5" );
- menu_setprop( menu, MPROP_EXITNAME, "\yClose" );
- menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
- menu_display( client, menu, 0 );
- }
- public caseMenu( client, menu, item )
- {
- if ( item == MENU_EXIT )
- {
- menu_destroy( menu );
- return;
- }
- new name[ 32 ];
- get_user_name( client, name , sizeof( name ) - 1);
- switch( item )
- {
- case 0: menu_action[ client ] = ENG_MENU;
- case 1: menu_action[ client ] = HEB_MENU;
- case 2: client_cmd( play_for_all[ client ] ? 0 : client, "mp3 stop" ), ColorChat( play_for_all[ client ] ? 0 : client, "%s^x04%s^x01 has stoped the music.", play_for_all[ client ] ? "Admin: " : "", name );
- case 3: if( get_user_flags( client ) & ADMIN_ACCESS ) play_for_all[ client ] = !play_for_all[ client ];
- case 4: if( Volume[ client ] > 1.0 )
- Volume[ client ] = 0.1;
- else
- Volume[ client ] += 0.1;
- }
- if(item < 2)
- cmdShowMusic( client );
- else
- cmdShowMenu( client );
- }
- public cmdShowMusic( client )
- {
- static title[ 128 ], item[ 128 ], info[ 10 ];
- formatex( title, sizeof( title ) - 1, "\y[Music]\d %s Music Menu", menu_action[ client ] ? "Hebrew" : "English");
- new menu = menu_create( title, "caseMusic" );
- if( menu_action[ client ] == ENG_MENU )
- for( new i; i < sizeof Eng_Songs_name; i++ ) {
- num_to_str( i+1, info, 9 );
- formatex( item, sizeof( item ) - 1, "%s", Eng_Songs_name[ i ] );
- menu_additem( menu, item, info );
- }
- else
- for( new i; i < sizeof Heb_Songs_name; i++ ) {
- num_to_str( i+1, info, 9 );
- formatex( item, sizeof( item ) - 1, "%s", Heb_Songs_name[ i ] );
- menu_additem( menu, item, info );
- }
- menu_setprop( menu, MPROP_EXITNAME, "\yBack" );
- menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
- menu_display( client, menu, 0 );
- }
- public caseMusic( client, menu, item )
- {
- if ( item == MENU_EXIT )
- {
- menu_destroy( menu );
- cmdShowMenu( client );
- return;
- }
- new name[ 32 ];
- get_user_name( client, name, sizeof( name ) - 1 );
- client_cmd( play_for_all[ client ] ? 0 : client, "mp3 play ^"sound/%s^"", menu_action[ client ] ? Heb_Songs_dir[ item ] : Eng_Songs_dir[ item ] );
- ColorChat( play_for_all[ client ] ? 0 : client, "%s^x04%s^x01 now playing^x03 %s^x01 song with^x03 %.1f^x01 Vollume.", play_for_all[ client ] ? "Admin: " : "", name, menu_action[ client ] ? Heb_Songs_name[ item ] : Eng_Songs_name[ item ], Volume[ client ] );
- client_cmd( play_for_all[ client ] ? 0 : client, "MP3Volume %.1f", Volume[ client ]);
- }
- stock ColorChat(const id, const string[], {Float, Sql, Resul,_}:...) {
- new msg[191], players[32], count = 1;
- static len;
- len = formatex(msg, charsmax(msg), "^x01[^x04 Music^x01 ] " );
- vformat(msg[len], charsmax(msg) - len, string, 3);
- if(id)
- players[0] = id;
- else
- get_players(players,count,"ch");
- for (new i = 0; i < count; i++)
- {
- if(is_user_connected(players[i]))
- {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"),_, players[i]);
- write_byte(players[i]);
- write_string(msg);
- message_end();
- }
- }
- return;
- }
- /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
- *{\\ rtf1\\ fbidis\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ ltrpar\\ lang1037\\ f0\\ fs16 \n\\ par }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement