Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********************************************************
- *
- * How to install
- *
- * Open new folder in named Songs inside Config
- *
- * Credits
- *
- * Shon the built mode
- *
- * Thanks to Niv for upgrading the plugin
- *
- * SUSYABASHTI on the Read the file (ReadFile)
- *
- ********************************************************/
- #include <amxmodx>
- #include <amxmisc>
- #include <dhudmessage>
- #define Plugin "New Advanced Music Menu"
- #define Version "v5.0"
- #define Author "Shon"
- new const Vol [] [] =
- {
- "[\r----------\w]",
- "[\y+\r---------\w]",
- "[\y++\r--------\w]",
- "[\y+++\r-------\w]",
- "[\y++++\r------\w]",
- "[\y+++++\r-----\w]",
- "[\y++++++\r----\w]",
- "[\y+++++++\r---\w]",
- "[\y++++++++\r--\w]",
- "[\y+++++++++\r-\w]",
- "[\y++++++++++\w]"
- }
- static title[ 128 ]
- new bool: BlockAdmin[ 33 ]
- new Array:g_aSongName1, Array:g_aSongTime1, Array:g_aSongAuthor1, Array:g_aSongFile1, g_iHebSongs, szSong[ 64 ], g_iSong[ 33 ], szConfigsDir[ 64 ], szMsg[ 192 ]
- new Array:g_aSongName2, Array:g_aSongTime2, Array:g_aSongAuthor2, Array:g_aSongFile2, g_iHipSongs, szTime[ 64 ], g_iTime[ 33 ], Arg[ 38 ], Change[ 33 ]
- new Array:g_aSongName3, Array:g_aSongTime3, Array:g_aSongAuthor3, Array:g_aSongFile3, g_iDubSongs, szAuthor[ 64 ], g_iAuthor[ 33 ], PlayAll[ 33 ], szNum[ 38 ]
- new Array:g_aSongName4, Array:g_aSongTime4, Array:g_aSongAuthor4, Array:g_aSongFile4, g_iMizSongs, szFile[ 64 ], g_iFile[ 33 ], Vole[ 33 ], Float: Volume[ 33 ]
- new const szPrefix[] = "PrefectList"
- public plugin_init()
- {
- register_plugin(Plugin, Version, Author)
- register_clcmd("say /music", "MusicMenu")
- register_clcmd("say ", "stop")
- register_menucmd(register_menuid("menu_music"), 1023, "sub_music")
- register_menucmd(register_menuid("OptionsMenu"), 1023, "cmdOption")
- set_task(45.0, "Message", _,_,_, "b")
- }
- public Message()
- return ColorChat(0, "if you want listen to music type: ^3/music^1")
- public plugin_end( )
- {
- ArrayDestroy( g_aSongTime1 ), ArrayDestroy( g_aSongName1 ), ArrayDestroy( g_aSongAuthor1 ),ArrayDestroy( g_aSongFile1 )
- ArrayDestroy( g_aSongTime2 ), ArrayDestroy( g_aSongName2 ), ArrayDestroy( g_aSongAuthor2 ),ArrayDestroy( g_aSongFile2 )
- ArrayDestroy( g_aSongTime3 ), ArrayDestroy( g_aSongName3 ), ArrayDestroy( g_aSongAuthor3 ),ArrayDestroy( g_aSongFile3 )
- ArrayDestroy( g_aSongTime4 ), ArrayDestroy( g_aSongName4 ), ArrayDestroy( g_aSongAuthor4 ),ArrayDestroy( g_aSongFile4 )
- }
- public client_putinserver( client )
- {
- PlayAll[ client ] = false
- BlockAdmin[ client ] = false
- Vole[ client ] = 6
- Volume[ client ] = 0.60
- }
- public plugin_precache()
- {
- readme( )
- ReadFile1( ), ReadFile2( )
- ReadFile3( ), ReadFile4( )
- }
- public MusicMenu( client )
- {
- new szMenu[1024], iLen, ikey = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_9|MENU_KEY_0
- iLen = format(szMenu[iLen], charsmax(szMenu)-iLen, "\r(\w %s \r)\w Music Menu^n^n", szPrefix)
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r1. \wHebrew^n") // Hebrew is Janer from israel :)
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r2. \wHiphop + Rap^n")
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r3. \wDubstep^n")
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r4. \wMizrhit^n^n") // Mizrhit is Janer from israel :)
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\y--------------------^n")
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r5. %s^n", Change[client] ? "\rStopMusic\w" : "\yRandom Music\w")
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r6. \yVol. \w%s^n", Vol [ Vole[ client ] ])
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\y--------------------^n^n")
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r9. \wOptions Menu^n^n")
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r0. \wExit")
- show_menu(client, ikey, szMenu, -1, "menu_music")
- return PLUGIN_HANDLED
- }
- public sub_music( client, key )
- {
- switch( key )
- {
- case 0: cmdHebrew( client )
- case 1: cmdHipHop( client )
- case 2: cmdDubstep( client )
- case 3: cmdMizrhit( client )
- case 4:
- {
- Change[client] = !Change[client]
- if( Change[client])
- {
- new randommusic = random_num(1,4)
- if ( randommusic == 1)
- {
- new hebrew = random_num(0,sizeof g_iHebSongs)
- ArrayGetString( g_aSongFile1, hebrew, szFile, charsmax( szFile ) )
- ArrayGetString( g_aSongName1, hebrew, szSong, charsmax( szSong ) )
- }
- if ( randommusic == 2 )
- {
- new hiphop = random_num(0,sizeof g_iHipSongs)
- ArrayGetString( g_aSongFile2, hiphop, szFile, charsmax( szFile ) )
- ArrayGetString( g_aSongName2, hiphop, szSong, charsmax( szSong ) )
- }
- if ( randommusic == 3 )
- {
- new dupstep = random_num(0,sizeof g_iDubSongs)
- ArrayGetString( g_aSongFile3, dupstep, szFile, charsmax( szFile ) )
- ArrayGetString( g_aSongName3, dupstep, szSong, charsmax( szSong ) )
- }
- if ( randommusic == 4 )
- {
- new mizrhit = random_num(0,sizeof g_iMizSongs)
- ArrayGetString( g_aSongFile4, mizrhit, szFile, charsmax( szFile ) )
- ArrayGetString( g_aSongName4, mizrhit, szSong, charsmax( szSong ) )
- }
- client_cmd(client, "mp3 play ^"sound/%s^"", szFile )
- ColorChat(client, "Enjoy listening to ^3%s^1 song", szSong )
- }
- else
- client_cmd(client, "mp3 stop")
- MusicMenu(client)
- }
- case 5:
- {
- if( Volume[ client ] > 1.00 )
- Volume[ client ] = 0.0;
- else
- Volume[ client ] += 0.10;
- if(Vole [ client ] == sizeof Vol - 1)
- Vole [ client ] = 0
- else
- Vole [ client ] ++
- client_cmd(client, "MP3Volume %.1f", Volume[ client ] )
- MusicMenu(client)
- }
- case 8: cmdOptions(client)
- }
- return PLUGIN_HANDLED
- }
- public cmdHebrew( client )
- {
- formatex( title, sizeof( title ) - 1, "\r(\w %s \r)\w Hebrew Music^nPage\y", szPrefix)
- new menu = menu_create( title, "caseHebrew" )
- for( new i = 0; i < g_iHebSongs; ++i )
- {
- ArrayGetString( g_aSongName1, i, szSong, charsmax( szSong ) )
- menu_additem( menu, szSong, "" )
- }
- menu_setprop( menu, MPROP_EXITNAME, "Back" )
- menu_setprop( menu, MPROP_EXIT, MEXIT_ALL )
- menu_display( client, menu, 0 )
- }
- public cmdHipHop( client )
- {
- formatex( title, sizeof( title ) - 1, "\r(\w %s \r)\w Hiphop Music^nPage\y", szPrefix)
- new menu = menu_create( title, "caseHiphop" )
- for( new i = 0; i < g_iHipSongs; ++i )
- {
- ArrayGetString( g_aSongName2, i, szSong, charsmax( szSong ) )
- menu_additem( menu, szSong, "" )
- }
- menu_setprop( menu, MPROP_EXITNAME, "Back" )
- menu_setprop( menu, MPROP_EXIT, MEXIT_ALL )
- menu_display( client, menu, 0 )
- }
- public cmdDubstep( client )
- {
- formatex( title, sizeof( title ) - 1, "\r(\w %s \r)\w Dubstep Music^nPage\y", szPrefix)
- new menu = menu_create( title, "caseDubstep" )
- for( new i = 0; i < g_iDubSongs; ++i )
- {
- ArrayGetString( g_aSongName3, i, szSong, charsmax( szSong ) )
- menu_additem( menu, szSong, "" )
- }
- menu_setprop( menu, MPROP_EXITNAME, "Back" )
- menu_setprop( menu, MPROP_EXIT, MEXIT_ALL )
- menu_display( client, menu, 0 )
- }
- public cmdMizrhit( client )
- {
- formatex( title, sizeof( title ) - 1, "\r(\w %s \r)\w Mizrhit Music^nPage\y", szPrefix)
- new menu = menu_create( title, "caseMizrhit" )
- for( new i = 0; i < g_iMizSongs; ++i )
- {
- ArrayGetString( g_aSongName4, i, szSong, charsmax( szSong ) )
- menu_additem( menu, szSong, "" )
- }
- menu_setprop( menu, MPROP_EXITNAME, "Back" )
- menu_setprop( menu, MPROP_EXIT, MEXIT_ALL )
- menu_display( client, menu, 0 )
- }
- public caseHebrew( client, menu, item )
- {
- if ( item == MENU_EXIT )
- MusicMenu( client )
- g_iSong[ client ] = item;
- g_iTime[ client ] = item;
- g_iAuthor[ client ] = item;
- g_iFile[ client ] = item;
- ArrayGetString( g_aSongFile1, g_iFile[ client ], szFile, charsmax( szSong ) )
- ArrayGetString( g_aSongName1, g_iSong[ client ], szSong, charsmax( szSong ) )
- ArrayGetString( g_aSongTime1, g_iTime[ client ], szTime, charsmax( szTime ) )
- ArrayGetString( g_aSongAuthor1, g_iAuthor[ client ], szAuthor, charsmax( szAuthor ) )
- cmdInfo( client )
- }
- public caseHiphop( client, menu, item )
- {
- if ( item == MENU_EXIT )
- MusicMenu( client )
- g_iSong[ client ] = item;
- g_iTime[ client ] = item;
- g_iAuthor[ client ] = item;
- g_iFile[ client ] = item;
- ArrayGetString( g_aSongFile2, g_iFile[ client ], szFile, charsmax( szSong ) )
- ArrayGetString( g_aSongName2, g_iSong[ client ], szSong, charsmax( szSong ) )
- ArrayGetString( g_aSongTime2, g_iTime[ client ], szTime, charsmax( szTime ) )
- ArrayGetString( g_aSongAuthor2, g_iAuthor[ client ], szAuthor, charsmax( szAuthor ) )
- cmdInfo( client )
- }
- public caseDubstep( client, menu, item )
- {
- if ( item == MENU_EXIT )
- MusicMenu( client )
- g_iSong[ client ] = item;
- g_iTime[ client ] = item;
- g_iAuthor[ client ] = item;
- g_iFile[ client ] = item;
- ArrayGetString( g_aSongFile3, g_iFile[ client ], szFile, charsmax( szFile ) )
- ArrayGetString( g_aSongName3, g_iSong[ client ], szSong, charsmax( szSong ) )
- ArrayGetString( g_aSongTime3, g_iTime[ client ], szTime, charsmax( szTime ) )
- ArrayGetString( g_aSongAuthor3, g_iAuthor[ client ], szAuthor, charsmax( szAuthor ) )
- cmdInfo( client )
- }
- public caseMizrhit( client, menu, item )
- {
- if ( item == MENU_EXIT )
- MusicMenu( client )
- g_iSong[ client ] = item;
- g_iTime[ client ] = item;
- g_iAuthor[ client ] = item;
- g_iFile[ client ] = item;
- ArrayGetString( g_aSongFile4, g_iFile[ client ], szFile, charsmax( szFile ) )
- ArrayGetString( g_aSongName4, g_iSong[ client ], szSong, charsmax( szSong ) )
- ArrayGetString( g_aSongTime4, g_iTime[ client ], szTime, charsmax( szTime ) )
- ArrayGetString( g_aSongAuthor4, g_iAuthor[ client ], szAuthor, charsmax( szAuthor ) )
- cmdInfo( client )
- }
- public cmdInfo( client )
- {
- formatex( title, charsmax( title ),
- "\r-. \dSong Info:^n^n\r-. \dSong Name: '\y%s\d'^n\r-. \dSong Time '\y%s\d'^n\r-. \dSong Author '\y%s\d'", szSong, szTime, szAuthor )
- new Menu = menu_create( title, "caseInfo" )
- menu_additem( Menu, "\d** \yPlay Song \d**" )
- menu_setprop( Menu, MPROP_EXITNAME, "Back" )
- menu_setprop( Menu, MPROP_EXIT, MEXIT_ALL )
- menu_display( client, Menu, 0 )
- }
- public caseInfo( client, menu, item )
- {
- if ( item == MENU_EXIT )
- MusicMenu( client )
- set_dhudmessage(97, 97, 97, -1.0, 0.12, 0, 6.0, 8.0)
- switch( item )
- {
- case 0:
- {
- client_cmd(client, "mp3 play ^"sound/%s^"", szFile)
- ColorChat(client, "Enjoy listening to ^3%s^1 song", szSong)
- client_cmd(client, "MP3Volume %.1f", Volume[ client ])
- for ( new i = 1; i < get_maxplayers(); i++ )
- {
- if(PlayAll[client])
- {
- show_dhudmessage(client, "Admin %s has started ^"%s^" song^n enjoy", GetName(client), szSong)
- if (!BlockAdmin[i])
- {
- client_cmd(i, "mp3 play ^"sound/%s^"", szFile)
- show_dhudmessage(i, "Admin %s has started ^"%s^" song^n enjoy", GetName(client), szSong)
- client_cmd(i, "MP3Volume %.1f", Volume[ i ])
- }
- }
- }
- }
- }
- return 0;
- }
- public cmdOptions( client )
- {
- new szMenu[1024], iLen, keys =
- iLen = format(szMenu[iLen], charsmax(szMenu)-iLen, "\r(\w %s \r)\w Options Menu^n^n", szPrefix)
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r1. \wBlock Admin Music: %s^n", BlockAdmin[ client ] ? "\rYes" : "\yNo" )
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\dThis options will bolck music^n" )
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\dwhen admin starts a song^n" )
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\y--------------------^n")
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "Admins Options^n^n")
- if(!(get_user_flags(client) & ADMIN_KICK))
- {
- keys = MENU_KEY_1|MENU_KEY_0
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\d2. \wPlay For All Players: \rNo^n")
- }
- else
- {
- keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_0
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r2. \wPlay For All Players: %s^n", PlayAll[ client ] ? "\yYes" : "\rNo")
- }
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\dSelect a song and it will^n")
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\dPlay for all players^n^n")
- if(!(get_user_flags(client) & ADMIN_KICK))
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\d5. \wStop Music For All Players^n")
- else
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r5. \wStop Music For All Players^n")
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\dStop music for all players^n")
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\y--------------------^n^n")
- iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r0. \wBack")
- show_menu(client, keys, szMenu, -1, "OptionsMenu")
- return PLUGIN_CONTINUE
- }
- public cmdOption( client, key )
- {
- switch( key )
- {
- case 0:
- {
- BlockAdmin[ client ] = !BlockAdmin[ client ]
- ColorChat(client, "You have^3 %s^1 music from admin", BlockAdmin[ client ] ? "Blocked" : "UnBlocked" )
- cmdOptions(client)
- }
- case 1:
- {
- PlayAll[ client ] = !PlayAll[ client ]
- ColorChat(client, "You have ^3%s^1 PlayForAll", PlayAll[ client ] ? "Enabled" : "Disabled")
- cmdOptions(client)
- }
- case 4:
- {
- client_cmd(0, "mp3 stop" )
- set_dhudmessage(97, 97, 97, -1.0, 0.12, 0, 6.0, 8.0)
- show_dhudmessage(0, "Admin %s has stopped^nThe music from all player", GetName(client) )
- ColorChat(0, "Admin ^3%s^1 has stopped music from all players.", GetName(client) )
- cmdOptions(client)
- }
- case 9: MusicMenu(client)
- }
- return PLUGIN_HANDLED
- }
- stock GetName( id )
- {
- static szName[ 32 ]
- get_user_name( id, szName, charsmax( szName ) )
- return szName
- }
- public stop(client)
- {
- read_argv( 1, szMsg, charsmax( szMsg ) )
- parse( szMsg, Arg, charsmax( Arg ), szNum, charsmax( szNum ) )
- if( equal( Arg, "/sm" ) || equal( Arg, "/stopmusic" ) || equal( Arg, "/StopMusic" ) || equal( Arg, "/Stop" ) || equal( Arg, "/stop" ) )
- {
- client_cmd(client, "mp3 stop")
- ColorChat(client, "You'r Stop The Music")
- }
- return PLUGIN_HANDLED
- }
- readme( )
- {
- get_configsdir( szConfigsDir, charsmax( szConfigsDir ) )
- add( szConfigsDir, charsmax( szConfigsDir ), "/Readme.txt" )
- if( !file_exists( szConfigsDir ) )
- {
- write_file( szConfigsDir, "; don't remove this txt" )
- write_file( szConfigsDir, "; if you delete this txt or .ini the plugin auto on off" )
- write_file( szConfigsDir, "; Create a new folder named ^"Songs^"" )
- write_file( szConfigsDir, "; To turn this plugin, You need at least one song in the Genre" )
- log_amx( "No Songs were found!" )
- pause( "a" )
- }
- return 1;
- }
- /* ReadFile */
- ReadFile1( ) // Hebrew
- {
- g_aSongName1 = ArrayCreate( 64, 1 )
- g_aSongTime1 = ArrayCreate( 64, 1 )
- g_aSongAuthor1 = ArrayCreate( 64, 1 )
- g_aSongFile1 = ArrayCreate( 64, 1 )
- get_configsdir( szConfigsDir, charsmax( szConfigsDir ) )
- add( szConfigsDir, charsmax( szConfigsDir ), "/Songs/Hebrew.ini" )
- if( !file_exists( szConfigsDir ) )
- {
- write_file( szConfigsDir, "; Here You Add Hebrew Song" )
- write_file( szConfigsDir, "; folder/Heberw/song.mp3 // no needed sound/!")
- write_file( szConfigsDir, "; ^"Ahi israeli^" ^"4:21^" ^"Atikva 6^" ^"music/Hebrew/AhiIsraeli.mp3^"" )
- log_amx( "No Songs were found!" )
- pause( "a" )
- return 1;
- }
- new iFile = fopen( szConfigsDir, "rt" )
- if( !iFile )
- return 0;
- new szBuffer[ 512 ], szSongName1[ 64 ], szSongTime1[ 64 ], szSongAuthor1[ 64 ], szSongFile1[ 64 ]
- while( !feof( iFile ) )
- {
- fgets( iFile, szBuffer, charsmax( szBuffer ) )
- replace( szBuffer, charsmax( szBuffer ), "^n", "" )
- if( !szBuffer[ 0 ] || szBuffer[ 0 ] == '/' || szBuffer[ 0 ] == ';' )
- continue;
- parse( szBuffer, szSongName1,63, szSongTime1,63, szSongAuthor1, 63, szSongFile1, 63)
- remove_quotes( szSongName1 )
- remove_quotes( szSongTime1 )
- remove_quotes( szSongAuthor1 )
- remove_quotes( szSongFile1 )
- precache_sound( szSongFile1 )
- log_amx( "Song Name: %s, Song Time: %s, Song Author: %s, Song File: %s", szSongName1, szSongTime1, szSongAuthor1, szSongFile1 )
- ArrayPushString( g_aSongName1, szSongName1 )
- ArrayPushString( g_aSongTime1, szSongTime1 )
- ArrayPushString( g_aSongAuthor1, szSongAuthor1 )
- ArrayPushString( g_aSongFile1, szSongFile1 )
- ++g_iHebSongs
- }
- if( !g_iHebSongs )
- {
- log_amx( "No Songs were found!" )
- return 1;
- }
- else
- {
- log_amx( "Total Songs Loaded: %i", g_iHebSongs )
- }
- return 1;
- }
- ReadFile2( ) // Hiphop
- {
- g_aSongName2 = ArrayCreate( 64, 1 )
- g_aSongTime2 = ArrayCreate( 64, 1 )
- g_aSongAuthor2 = ArrayCreate( 64, 1 )
- g_aSongFile2 = ArrayCreate( 64, 1 )
- get_configsdir( szConfigsDir, charsmax( szConfigsDir ) )
- add( szConfigsDir, charsmax( szConfigsDir ), "/Songs/Hiphop.ini" )
- if( !file_exists( szConfigsDir ) )
- {
- write_file( szConfigsDir, "; Here You Add Hiphop Song" )
- write_file( szConfigsDir, "; folder/Hiphip/song.mp3 // no needed sound/ !")
- write_file( szConfigsDir, "; ^"Rap God^" ^"6:09^" ^"Eminem^" ^"music/Hiphop/RapGod.mp3^"" )
- log_amx( "No Songs were found!" )
- pause( "a" )
- return 1;
- }
- new iFile = fopen( szConfigsDir, "rt" )
- if( !iFile )
- return 0;
- new szBuffer[ 512 ], szSongName2[ 64 ], szSongTime2[ 64 ], szSongAuthor2[ 64 ], szSongFile2[ 64 ]
- while( !feof( iFile ) )
- {
- fgets( iFile, szBuffer, charsmax( szBuffer ) )
- replace( szBuffer, charsmax( szBuffer ), "^n", "" )
- if( !szBuffer[ 0 ] || szBuffer[ 0 ] == '/' || szBuffer[ 0 ] == ';' )
- continue;
- parse( szBuffer, szSongName2,63, szSongTime2,63, szSongAuthor2, 63, szSongFile2, 63, szSongFile2, 63)
- remove_quotes( szSongName2 )
- remove_quotes( szSongTime2 )
- remove_quotes( szSongAuthor2 )
- remove_quotes( szSongFile2 )
- precache_sound( szSongFile2 )
- log_amx( "Song Name: %s, Song Time: %s, Song Author: %s, Song File: %s", szSongName2, szSongTime2, szSongAuthor2, szSongFile2 )
- ArrayPushString( g_aSongName2, szSongName2 )
- ArrayPushString( g_aSongTime2, szSongTime2 )
- ArrayPushString( g_aSongAuthor2, szSongAuthor2 )
- ArrayPushString( g_aSongFile2, szSongFile2 )
- ++g_iHipSongs
- }
- if( !g_iHipSongs )
- {
- log_amx( "No Songs were found!" )
- return 1;
- }
- else
- {
- log_amx( "Total Songs Loaded: %i", g_iHipSongs )
- }
- return 1;
- }
- ReadFile3( ) // Dubstep
- {
- g_aSongName3 = ArrayCreate( 64, 1 )
- g_aSongTime3 = ArrayCreate( 64, 1 )
- g_aSongAuthor3 = ArrayCreate( 64, 1 )
- g_aSongFile3 = ArrayCreate( 64, 1 )
- get_configsdir( szConfigsDir, charsmax( szConfigsDir ) )
- add( szConfigsDir, charsmax( szConfigsDir ), "/Songs/Dubstep.ini" )
- if( !file_exists( szConfigsDir ) )
- {
- write_file( szConfigsDir, "; Here You Add Dubstep Song" )
- write_file( szConfigsDir, "; folder/Dupstep/song.mp3 // no needed sound/ !")
- write_file( szConfigsDir, "; ^"First Of The Year^" ^"3:14^" ^"Skrillex^" ^"music/Dubstep/Timber.mp3^"" )
- log_amx( "No Songs were found!" )
- pause( "a" )
- return 1;
- }
- new iFile = fopen( szConfigsDir, "rt" )
- if( !iFile )
- return 0;
- new szBuffer[ 512 ], szSongName3[ 64 ], szSongTime3[ 64 ], szSongAuthor3[ 64 ], szSongFile3[ 64 ]
- while( !feof( iFile ) )
- {
- fgets( iFile, szBuffer, charsmax( szBuffer ) )
- replace( szBuffer, charsmax( szBuffer ), "^n", "" )
- if( !szBuffer[ 0 ] || szBuffer[ 0 ] == '/' || szBuffer[ 0 ] == ';' )
- continue;
- parse( szBuffer, szSongName3,63, szSongTime3,63, szSongAuthor3, 63, szSongFile3, 63)
- remove_quotes( szSongName3 )
- remove_quotes( szSongTime3 )
- remove_quotes( szSongAuthor3 )
- remove_quotes( szSongFile3 )
- precache_sound( szSongFile3 )
- log_amx( "Song Name: %s, Song Time: %s, Song Author: %s, Song File: %s", szSongName3, szSongTime3, szSongAuthor3, szSongFile3 )
- ArrayPushString( g_aSongName3, szSongName3 )
- ArrayPushString( g_aSongTime3, szSongTime3 )
- ArrayPushString( g_aSongAuthor3, szSongAuthor3 )
- ArrayPushString( g_aSongFile3, szSongFile3 )
- ++g_iDubSongs
- }
- if( !g_iDubSongs )
- {
- log_amx( "No Songs were found!" )
- return 1;
- }
- else
- {
- log_amx( "Total Songs Loaded: %i", g_iDubSongs )
- }
- return 1;
- }
- ReadFile4( ) // Mizrhit
- {
- g_aSongName4 = ArrayCreate( 64, 1 )
- g_aSongTime4 = ArrayCreate( 64, 1 )
- g_aSongAuthor4 = ArrayCreate( 64, 1 )
- g_aSongFile4 = ArrayCreate( 64, 1 )
- get_configsdir( szConfigsDir, charsmax( szConfigsDir ) )
- add( szConfigsDir, charsmax( szConfigsDir ), "/Songs/Mizrhit.ini" )
- if( !file_exists( szConfigsDir ) )
- {
- write_file( szConfigsDir, "; Here You Add Mizrhit Song" )
- write_file( szConfigsDir, "; folder/Mizrhit/song.mp3 // no needed sound/ !")
- write_file( szConfigsDir, "; ^"At^" ^"3:20^" ^"Eyal Golan^" ^"music/Mizrhit/At.mp3^"" )
- log_amx( "No Songs were found!" )
- pause( "a" )
- return 1;
- }
- new iFile = fopen( szConfigsDir, "rt" )
- if( !iFile )
- return 0;
- new szBuffer[ 512 ], szSongName4[ 64 ], szSongTime4[ 64 ], szSongAuthor4[ 64 ], szSongFile4[ 64 ]
- while( !feof( iFile ) )
- {
- fgets( iFile, szBuffer, charsmax( szBuffer ) )
- replace( szBuffer, charsmax( szBuffer ), "^n", "" )
- if( !szBuffer[ 0 ] || szBuffer[ 0 ] == '/' || szBuffer[ 0 ] == ';' )
- continue;
- parse( szBuffer, szSongName4,63, szSongTime4,63, szSongAuthor4, 63, szSongFile4, 63)
- remove_quotes( szSongName4 )
- remove_quotes( szSongTime4 )
- remove_quotes( szSongAuthor4 )
- remove_quotes( szSongFile4 )
- precache_sound( szSongFile4 )
- log_amx( "Song Name: %s, Song Time: %s, Song Author: %s, Song File: %s", szSongName4, szSongTime4, szSongAuthor4, szSongFile4 )
- ArrayPushString( g_aSongName4, szSongName4 )
- ArrayPushString( g_aSongTime4, szSongTime4 )
- ArrayPushString( g_aSongAuthor4, szSongAuthor4 )
- ArrayPushString( g_aSongFile4, szSongFile4 )
- ++g_iMizSongs
- }
- if( !g_iMizSongs )
- {
- log_amx( "No Songs were found!" )
- return 1;
- }
- else
- {
- log_amx( "Total Songs Loaded: %i", g_iMizSongs )
- }
- return 1;
- }
- stock ColorChat(const id, const string[], {Float, Sql, Resul,_}:...)
- {
- new msg[191], players[32], count = 1;
- static len
- len = formatex(msg, charsmax(msg), "^4[^1 %s^4 ]^1 ", szPrefix )
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement