SHARE
TWEET

Untitled

a guest Jul 12th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /********************************************************
  2. *
  3. *      How to install
  4. *
  5. *      Open new folder in named Songs inside Config
  6. *
  7. *      Credits
  8. *
  9. *      Shon the built mode
  10. *
  11. *      Thanks to Niv for upgrading the plugin
  12. *
  13. *      SUSYABASHTI on the Read the file (ReadFile)
  14. *
  15. ********************************************************/
  16.  
  17. #include <amxmodx>
  18. #include <amxmisc>
  19. #include <dhudmessage>
  20.  
  21. #define Plugin "New Advanced Music Menu"
  22. #define Version "v5.0"
  23. #define Author "Shon"
  24.  
  25. new const Vol [] [] =
  26. {
  27.     "[\r----------\w]",
  28.     "[\y+\r---------\w]",
  29.     "[\y++\r--------\w]",
  30.     "[\y+++\r-------\w]",
  31.     "[\y++++\r------\w]",
  32.     "[\y+++++\r-----\w]",
  33.     "[\y++++++\r----\w]",
  34.     "[\y+++++++\r---\w]",
  35.     "[\y++++++++\r--\w]",
  36.     "[\y+++++++++\r-\w]",
  37.     "[\y++++++++++\w]"
  38. }
  39.  
  40. static title[ 128 ]
  41. new bool: BlockAdmin[ 33 ]
  42. new Array:g_aSongName1, Array:g_aSongTime1, Array:g_aSongAuthor1, Array:g_aSongFile1, g_iHebSongs, szSong[ 64 ], g_iSong[ 33 ], szConfigsDir[ 64 ], szMsg[ 192 ]
  43. new Array:g_aSongName2, Array:g_aSongTime2, Array:g_aSongAuthor2, Array:g_aSongFile2, g_iHipSongs, szTime[ 64 ], g_iTime[ 33 ], Arg[ 38 ], Change[ 33 ]
  44. new Array:g_aSongName3, Array:g_aSongTime3, Array:g_aSongAuthor3, Array:g_aSongFile3, g_iDubSongs, szAuthor[ 64 ], g_iAuthor[ 33 ], PlayAll[ 33 ], szNum[ 38 ]
  45. 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 ]
  46.  
  47. new const szPrefix[] = "PrefectList"
  48.  
  49. public plugin_init()
  50. {
  51.     register_plugin(Plugin, Version, Author)
  52.    
  53.     register_clcmd("say /music", "MusicMenu")
  54.     register_clcmd("say ", "stop")
  55.     register_menucmd(register_menuid("menu_music"), 1023, "sub_music")
  56.     register_menucmd(register_menuid("OptionsMenu"), 1023, "cmdOption")
  57.     set_task(45.0, "Message", _,_,_, "b")
  58. }
  59.  
  60. public Message()
  61. return ColorChat(0, "if you want listen to music type: ^3/music^1")
  62.  
  63. public plugin_end( )
  64. {
  65.         ArrayDestroy( g_aSongTime1 ), ArrayDestroy( g_aSongName1 ), ArrayDestroy( g_aSongAuthor1 ),ArrayDestroy( g_aSongFile1 )
  66.         ArrayDestroy( g_aSongTime2 ), ArrayDestroy( g_aSongName2 ), ArrayDestroy( g_aSongAuthor2 ),ArrayDestroy( g_aSongFile2 )
  67.         ArrayDestroy( g_aSongTime3 ), ArrayDestroy( g_aSongName3 ), ArrayDestroy( g_aSongAuthor3 ),ArrayDestroy( g_aSongFile3 )
  68.         ArrayDestroy( g_aSongTime4 ), ArrayDestroy( g_aSongName4 ), ArrayDestroy( g_aSongAuthor4 ),ArrayDestroy( g_aSongFile4 )
  69. }
  70.  
  71. public client_putinserver( client )
  72. {
  73.     PlayAll[ client ] = false
  74.     BlockAdmin[ client ] = false
  75.     Vole[ client ] = 6
  76.     Volume[ client ] = 0.60
  77. }
  78.  
  79. public plugin_precache()
  80. {
  81.     readme( )
  82.     ReadFile1( ), ReadFile2( )
  83.     ReadFile3( ), ReadFile4( )
  84. }
  85.  
  86. public MusicMenu( client )
  87. {
  88.     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
  89.     iLen = format(szMenu[iLen], charsmax(szMenu)-iLen,  "\r(\w %s \r)\w Music Menu^n^n", szPrefix)
  90.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r1. \wHebrew^n") // Hebrew is Janer from israel :)
  91.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r2. \wHiphop + Rap^n")
  92.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r3. \wDubstep^n")
  93.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r4. \wMizrhit^n^n") // Mizrhit is Janer from israel :)
  94.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\y--------------------^n")
  95.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r5. %s^n", Change[client] ? "\rStopMusic\w" : "\yRandom Music\w")
  96.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r6. \yVol. \w%s^n", Vol [ Vole[ client ] ])
  97.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\y--------------------^n^n")
  98.    
  99.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r9. \wOptions Menu^n^n")
  100.    
  101.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r0. \wExit")
  102.    
  103.     show_menu(client, ikey, szMenu, -1, "menu_music")
  104.     return PLUGIN_HANDLED
  105. }
  106.  
  107. public sub_music( client, key )
  108. {
  109.     switch( key )
  110.     {
  111.     case 0: cmdHebrew( client )
  112.     case 1: cmdHipHop( client )
  113.     case 2: cmdDubstep( client )
  114.     case 3: cmdMizrhit( client )
  115.    
  116.     case 4:
  117.     {
  118.     Change[client] = !Change[client]
  119.     if( Change[client])
  120.     {
  121.     new randommusic = random_num(1,4)
  122.    
  123.     if ( randommusic == 1)
  124.     {  
  125.         new hebrew = random_num(0,sizeof g_iHebSongs)
  126.         ArrayGetString( g_aSongFile1, hebrew, szFile, charsmax( szFile ) )
  127.         ArrayGetString( g_aSongName1, hebrew, szSong, charsmax( szSong ) )
  128.     }
  129.     if ( randommusic == 2 )
  130.     {  
  131.         new hiphop = random_num(0,sizeof g_iHipSongs)
  132.         ArrayGetString( g_aSongFile2, hiphop, szFile, charsmax( szFile ) )
  133.         ArrayGetString( g_aSongName2, hiphop, szSong, charsmax( szSong ) )
  134.     }
  135.     if ( randommusic == 3 )
  136.     {  
  137.         new dupstep = random_num(0,sizeof g_iDubSongs)
  138.         ArrayGetString( g_aSongFile3, dupstep, szFile, charsmax( szFile ) )
  139.         ArrayGetString( g_aSongName3, dupstep, szSong, charsmax( szSong ) )
  140.     }
  141.     if ( randommusic == 4 )
  142.     {  
  143.         new mizrhit = random_num(0,sizeof g_iMizSongs)
  144.         ArrayGetString( g_aSongFile4, mizrhit, szFile, charsmax( szFile ) )
  145.         ArrayGetString( g_aSongName4, mizrhit, szSong, charsmax( szSong ) )
  146.     }
  147.     client_cmd(client, "mp3 play ^"sound/%s^"", szFile )   
  148.     ColorChat(client, "Enjoy listening to ^3%s^1 song", szSong )
  149.     }
  150.     else
  151.     client_cmd(client, "mp3 stop")
  152.     MusicMenu(client)
  153.     }
  154.     case 5:
  155.     {
  156.     if( Volume[ client ] > 1.00 )
  157.         Volume[ client ] = 0.0;
  158.     else
  159.         Volume[ client ] += 0.10;
  160.     if(Vole [ client ] == sizeof Vol - 1)
  161.         Vole [ client ] = 0
  162.     else
  163.         Vole [ client ] ++
  164.     client_cmd(client, "MP3Volume %.1f", Volume[ client ] )
  165.     MusicMenu(client)
  166.     }
  167.    
  168.     case 8: cmdOptions(client)
  169.     }
  170.     return PLUGIN_HANDLED
  171. }
  172.  
  173. public cmdHebrew( client )
  174. {
  175.     formatex( title, sizeof( title ) - 1, "\r(\w %s \r)\w Hebrew Music^nPage\y", szPrefix)
  176.     new menu = menu_create( title, "caseHebrew" )
  177.  
  178.     for( new i = 0; i < g_iHebSongs; ++i )
  179.     {
  180.         ArrayGetString( g_aSongName1, i, szSong, charsmax( szSong ) )
  181.              
  182.         menu_additem( menu, szSong, "" )
  183.     }
  184.    
  185.     menu_setprop( menu, MPROP_EXITNAME, "Back" )
  186.     menu_setprop( menu, MPROP_EXIT, MEXIT_ALL )
  187.     menu_display( client, menu, 0 )
  188. }
  189.  
  190. public cmdHipHop( client )
  191. {
  192.     formatex( title, sizeof( title ) - 1, "\r(\w %s \r)\w Hiphop Music^nPage\y", szPrefix)
  193.     new menu = menu_create( title, "caseHiphop" )
  194.  
  195.     for( new i = 0; i < g_iHipSongs; ++i )
  196.     {
  197.         ArrayGetString( g_aSongName2, i, szSong, charsmax( szSong ) )
  198.              
  199.         menu_additem( menu, szSong, "" )
  200.     }
  201.  
  202.     menu_setprop( menu, MPROP_EXITNAME, "Back" )
  203.     menu_setprop( menu, MPROP_EXIT, MEXIT_ALL )
  204.     menu_display( client, menu, 0 )
  205. }
  206.  
  207. public cmdDubstep( client )
  208. {
  209.     formatex( title, sizeof( title ) - 1, "\r(\w %s \r)\w Dubstep Music^nPage\y", szPrefix)
  210.     new menu = menu_create( title, "caseDubstep" )
  211.    
  212.     for( new i = 0; i < g_iDubSongs; ++i )
  213.     {
  214.         ArrayGetString( g_aSongName3, i, szSong, charsmax( szSong ) )
  215.                
  216.         menu_additem( menu, szSong, "" )
  217.     }
  218.  
  219.     menu_setprop( menu, MPROP_EXITNAME, "Back" )
  220.     menu_setprop( menu, MPROP_EXIT, MEXIT_ALL )
  221.     menu_display( client, menu, 0 )
  222. }
  223.  
  224. public cmdMizrhit( client )
  225. {
  226.     formatex( title, sizeof( title ) - 1, "\r(\w %s \r)\w Mizrhit Music^nPage\y", szPrefix)
  227.     new menu = menu_create( title, "caseMizrhit" )
  228.  
  229.     for( new i = 0; i < g_iMizSongs; ++i )
  230.     {
  231.         ArrayGetString( g_aSongName4, i, szSong, charsmax( szSong ) )
  232.            
  233.         menu_additem( menu, szSong, "" )
  234.     }
  235.    
  236.     menu_setprop( menu, MPROP_EXITNAME, "Back" )
  237.     menu_setprop( menu, MPROP_EXIT, MEXIT_ALL )
  238.     menu_display( client, menu, 0 )
  239. }
  240.  
  241. public caseHebrew( client, menu, item )
  242. {
  243.     if ( item == MENU_EXIT )
  244.         MusicMenu( client )
  245.    
  246.     g_iSong[ client ] = item;
  247.     g_iTime[ client ] = item;
  248.     g_iAuthor[ client ] = item;
  249.     g_iFile[ client ] = item;
  250.    
  251.          ArrayGetString( g_aSongFile1, g_iFile[ client ], szFile, charsmax( szSong ) )
  252.          ArrayGetString( g_aSongName1, g_iSong[ client ], szSong, charsmax( szSong ) )
  253.          ArrayGetString( g_aSongTime1, g_iTime[ client ], szTime, charsmax( szTime ) )
  254.          ArrayGetString( g_aSongAuthor1, g_iAuthor[ client ], szAuthor, charsmax( szAuthor ) )
  255.    
  256.     cmdInfo( client )
  257. }
  258.  
  259. public caseHiphop( client, menu, item )
  260. {
  261.     if ( item == MENU_EXIT )
  262.         MusicMenu( client )
  263.  
  264.     g_iSong[ client ] = item;
  265.     g_iTime[ client ] = item;
  266.     g_iAuthor[ client ] = item;
  267.     g_iFile[ client ] = item;
  268.    
  269.          ArrayGetString( g_aSongFile2, g_iFile[ client ], szFile, charsmax( szSong ) )
  270.          ArrayGetString( g_aSongName2, g_iSong[ client ], szSong, charsmax( szSong ) )
  271.          ArrayGetString( g_aSongTime2, g_iTime[ client ], szTime, charsmax( szTime ) )
  272.          ArrayGetString( g_aSongAuthor2, g_iAuthor[ client ], szAuthor, charsmax( szAuthor ) )
  273.      
  274.     cmdInfo( client )
  275. }
  276.  
  277. public caseDubstep( client, menu, item )
  278. {
  279.     if ( item == MENU_EXIT )
  280.         MusicMenu( client )
  281.    
  282.     g_iSong[ client ] = item;
  283.     g_iTime[ client ] = item;
  284.     g_iAuthor[ client ] = item;
  285.     g_iFile[ client ] = item;
  286.    
  287.          ArrayGetString( g_aSongFile3, g_iFile[ client ], szFile, charsmax( szFile ) )
  288.          ArrayGetString( g_aSongName3, g_iSong[ client ], szSong, charsmax( szSong ) )
  289.          ArrayGetString( g_aSongTime3, g_iTime[ client ], szTime, charsmax( szTime ) )
  290.          ArrayGetString( g_aSongAuthor3, g_iAuthor[ client ], szAuthor, charsmax( szAuthor ) )
  291.      
  292.     cmdInfo( client )
  293. }
  294.  
  295. public caseMizrhit( client, menu, item )
  296. {
  297.     if ( item == MENU_EXIT )
  298.         MusicMenu( client )
  299.    
  300.     g_iSong[ client ] = item;
  301.     g_iTime[ client ] = item;
  302.     g_iAuthor[ client ] = item;
  303.     g_iFile[ client ] = item;
  304.  
  305.          ArrayGetString( g_aSongFile4, g_iFile[ client ], szFile, charsmax( szFile ) )
  306.          ArrayGetString( g_aSongName4, g_iSong[ client ], szSong, charsmax( szSong ) )
  307.          ArrayGetString( g_aSongTime4, g_iTime[ client ], szTime, charsmax( szTime ) )
  308.          ArrayGetString( g_aSongAuthor4, g_iAuthor[ client ], szAuthor, charsmax( szAuthor ) )
  309.      
  310.     cmdInfo( client )
  311. }
  312.  
  313. public cmdInfo( client )
  314. {
  315.     formatex( title, charsmax( title ),
  316.     "\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 )
  317.     new Menu = menu_create( title, "caseInfo" )
  318.  
  319.     menu_additem( Menu, "\d** \yPlay Song \d**" )
  320.    
  321.     menu_setprop( Menu, MPROP_EXITNAME, "Back" )
  322.     menu_setprop( Menu, MPROP_EXIT, MEXIT_ALL )
  323.     menu_display( client, Menu, 0 )
  324. }
  325.  
  326. public caseInfo( client, menu, item )
  327. {  
  328.     if ( item == MENU_EXIT )
  329.         MusicMenu( client )
  330.    
  331.     set_dhudmessage(97, 97, 97, -1.0, 0.12, 0, 6.0, 8.0)
  332.    
  333.     switch( item )
  334.     {
  335.     case 0:
  336.     {
  337.     client_cmd(client, "mp3 play ^"sound/%s^"", szFile)
  338.     ColorChat(client, "Enjoy listening to ^3%s^1 song", szSong)
  339.     client_cmd(client, "MP3Volume %.1f", Volume[ client ])
  340.     for ( new i = 1; i < get_maxplayers(); i++ )
  341.     {
  342.     if(PlayAll[client])
  343.     {
  344.     show_dhudmessage(client, "Admin %s has started ^"%s^" song^n enjoy", GetName(client), szSong)  
  345.     if (!BlockAdmin[i])
  346.     {
  347.     client_cmd(i, "mp3 play ^"sound/%s^"", szFile)
  348.     show_dhudmessage(i, "Admin %s has started ^"%s^" song^n enjoy", GetName(client), szSong)
  349.     client_cmd(i, "MP3Volume %.1f", Volume[ i ])
  350.     }
  351.     }
  352.     }
  353.     }
  354.     }
  355.     return 0;
  356. }
  357.  
  358. public cmdOptions( client )
  359. {    
  360.     new szMenu[1024], iLen, keys =
  361.     iLen =  format(szMenu[iLen], charsmax(szMenu)-iLen,  "\r(\w %s \r)\w Options Menu^n^n", szPrefix)
  362.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r1. \wBlock Admin Music: %s^n", BlockAdmin[ client ] ? "\rYes" : "\yNo" )
  363.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\dThis options will bolck music^n" )
  364.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\dwhen admin starts a song^n" )
  365.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\y--------------------^n")
  366.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "Admins Options^n^n")
  367.     if(!(get_user_flags(client) & ADMIN_KICK))
  368.     {
  369.     keys = MENU_KEY_1|MENU_KEY_0
  370.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\d2. \wPlay For All Players: \rNo^n")
  371.     }
  372.     else
  373.     {
  374.     keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_0
  375.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r2. \wPlay For All Players: %s^n", PlayAll[ client ] ? "\yYes" : "\rNo")
  376.     }
  377.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\dSelect a song and it will^n")
  378.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\dPlay for all players^n^n")
  379.     if(!(get_user_flags(client) & ADMIN_KICK))
  380.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\d5. \wStop Music For All Players^n")
  381.     else
  382.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r5. \wStop Music For All Players^n")
  383.    
  384.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\dStop music for all players^n")
  385.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\y--------------------^n^n")
  386.    
  387.     iLen += format(szMenu[iLen], charsmax(szMenu)-iLen, "\r0. \wBack")
  388.    
  389.     show_menu(client, keys, szMenu, -1, "OptionsMenu")
  390.     return PLUGIN_CONTINUE
  391. }
  392.  
  393. public cmdOption( client, key )
  394. {  
  395.     switch( key )
  396.     {
  397.     case 0:
  398.     {
  399.     BlockAdmin[ client ] = !BlockAdmin[ client ]
  400.     ColorChat(client, "You have^3 %s^1 music from admin", BlockAdmin[ client ] ? "Blocked" : "UnBlocked" )
  401.     cmdOptions(client)
  402.     }
  403.     case 1:
  404.     {
  405.     PlayAll[ client ] = !PlayAll[ client ]
  406.     ColorChat(client, "You have ^3%s^1 PlayForAll", PlayAll[ client ] ? "Enabled" : "Disabled")
  407.     cmdOptions(client)
  408.     }
  409.     case 4:
  410.     {
  411.     client_cmd(0, "mp3 stop" )
  412.     set_dhudmessage(97, 97, 97, -1.0, 0.12, 0, 6.0, 8.0)
  413.     show_dhudmessage(0, "Admin %s has stopped^nThe music from all player", GetName(client) )
  414.     ColorChat(0, "Admin ^3%s^1 has stopped music from all players.", GetName(client) )
  415.     cmdOptions(client)
  416.     }
  417.     case 9: MusicMenu(client)
  418.     }
  419.     return PLUGIN_HANDLED
  420. }
  421.  
  422. stock GetName( id )
  423. {
  424.     static szName[ 32 ]
  425.    
  426.     get_user_name( id, szName, charsmax( szName ) )
  427.    
  428.     return szName
  429. }
  430.  
  431. public stop(client)
  432. {
  433.     read_argv( 1, szMsg, charsmax( szMsg ) )
  434.     parse( szMsg, Arg, charsmax( Arg ), szNum, charsmax( szNum ) )
  435.    
  436.     if( equal( Arg, "/sm" ) || equal( Arg, "/stopmusic" ) || equal( Arg, "/StopMusic" ) || equal( Arg, "/Stop" ) || equal( Arg, "/stop" ) )
  437.          {
  438.     client_cmd(client, "mp3 stop")
  439.     ColorChat(client, "You'r Stop The Music")
  440.     }
  441.     return PLUGIN_HANDLED
  442. }
  443.  
  444. readme( )
  445. {
  446.         get_configsdir( szConfigsDir, charsmax( szConfigsDir ) )
  447.        
  448.         add( szConfigsDir, charsmax( szConfigsDir ), "/Readme.txt" )
  449.        
  450.         if( !file_exists( szConfigsDir ) )
  451.         {
  452.                 write_file( szConfigsDir, "; don't remove this txt" )
  453.                 write_file( szConfigsDir, "; if you delete this txt or .ini the plugin auto on off" )
  454.                 write_file( szConfigsDir, "; Create a new folder named ^"Songs^"" )
  455.                 write_file( szConfigsDir, "; To turn this plugin, You need at least one song in the Genre" )
  456.                 log_amx( "No Songs were found!" )
  457.                 pause( "a" )
  458.         }
  459.     return 1;
  460. }
  461.  
  462. /* ReadFile */
  463. ReadFile1( ) // Hebrew
  464. {
  465.         g_aSongName1 = ArrayCreate( 64, 1 )
  466.         g_aSongTime1 = ArrayCreate( 64, 1 )
  467.         g_aSongAuthor1 = ArrayCreate( 64, 1 )
  468.         g_aSongFile1 = ArrayCreate( 64, 1 )
  469.        
  470.         get_configsdir( szConfigsDir, charsmax( szConfigsDir ) )
  471.        
  472.         add( szConfigsDir, charsmax( szConfigsDir ), "/Songs/Hebrew.ini" )
  473.        
  474.         if( !file_exists( szConfigsDir ) )
  475.         {
  476.                 write_file( szConfigsDir, "; Here You Add Hebrew Song" )
  477.         write_file( szConfigsDir, "; folder/Heberw/song.mp3 // no needed sound/!")
  478.                 write_file( szConfigsDir, "; ^"Ahi israeli^" ^"4:21^" ^"Atikva 6^" ^"music/Hebrew/AhiIsraeli.mp3^"" )
  479.                 log_amx( "No Songs were found!" )
  480.                 pause( "a" )
  481.                 return 1;
  482.         }
  483.    
  484.         new iFile = fopen( szConfigsDir, "rt" )
  485.        
  486.         if( !iFile )
  487.                 return 0;
  488.                
  489.         new szBuffer[ 512 ], szSongName1[ 64 ], szSongTime1[ 64 ], szSongAuthor1[ 64 ], szSongFile1[ 64 ]
  490.                
  491.         while( !feof( iFile ) )
  492.         {
  493.                 fgets( iFile, szBuffer, charsmax( szBuffer ) )
  494.                
  495.                 replace( szBuffer, charsmax( szBuffer ), "^n", "" )
  496.                
  497.                 if( !szBuffer[ 0 ] || szBuffer[ 0 ] == '/' || szBuffer[ 0 ] == ';' )
  498.                         continue;
  499.            
  500.                 parse( szBuffer, szSongName1,63, szSongTime1,63, szSongAuthor1, 63, szSongFile1, 63)
  501.  
  502.                 remove_quotes( szSongName1 )
  503.                 remove_quotes( szSongTime1 )
  504.                 remove_quotes( szSongAuthor1 )
  505.                 remove_quotes( szSongFile1 )
  506.        
  507.                 precache_sound( szSongFile1 )
  508.                
  509.                 log_amx( "Song Name: %s, Song Time: %s, Song Author: %s, Song File: %s", szSongName1, szSongTime1, szSongAuthor1, szSongFile1 )
  510.                
  511.                 ArrayPushString( g_aSongName1, szSongName1 )
  512.                 ArrayPushString( g_aSongTime1, szSongTime1 )
  513.                 ArrayPushString( g_aSongAuthor1, szSongAuthor1 )
  514.                 ArrayPushString( g_aSongFile1, szSongFile1 )
  515.                
  516.                 ++g_iHebSongs
  517.         }
  518.        
  519.         if( !g_iHebSongs )
  520.         {
  521.                 log_amx( "No Songs were found!" )
  522.                 return 1;
  523.         }
  524.        
  525.         else
  526.         {
  527.                 log_amx( "Total Songs Loaded: %i", g_iHebSongs )
  528.         }
  529.        
  530.         return 1;
  531. }
  532.  
  533. ReadFile2( ) // Hiphop
  534. {
  535.         g_aSongName2 = ArrayCreate( 64, 1 )
  536.         g_aSongTime2 = ArrayCreate( 64, 1 )
  537.         g_aSongAuthor2 = ArrayCreate( 64, 1 )
  538.         g_aSongFile2 = ArrayCreate( 64, 1 )
  539.        
  540.         get_configsdir( szConfigsDir, charsmax( szConfigsDir ) )
  541.        
  542.         add( szConfigsDir, charsmax( szConfigsDir ), "/Songs/Hiphop.ini" )
  543.        
  544.         if( !file_exists( szConfigsDir ) )
  545.         {
  546.                 write_file( szConfigsDir, "; Here You Add Hiphop Song" )
  547.         write_file( szConfigsDir, "; folder/Hiphip/song.mp3 // no needed sound/ !")
  548.                 write_file( szConfigsDir, "; ^"Rap God^" ^"6:09^" ^"Eminem^" ^"music/Hiphop/RapGod.mp3^"" )
  549.                 log_amx( "No Songs were found!" )
  550.                 pause( "a" )
  551.                 return 1;
  552.         }
  553.        
  554.         new iFile = fopen( szConfigsDir, "rt" )
  555.        
  556.         if( !iFile )
  557.                 return 0;
  558.                
  559.         new szBuffer[ 512 ], szSongName2[ 64 ], szSongTime2[ 64 ], szSongAuthor2[ 64 ], szSongFile2[ 64 ]
  560.                
  561.         while( !feof( iFile ) )
  562.         {
  563.                 fgets( iFile, szBuffer, charsmax( szBuffer ) )
  564.                
  565.                 replace( szBuffer, charsmax( szBuffer ), "^n", "" )
  566.                
  567.                 if( !szBuffer[ 0 ] || szBuffer[ 0 ] == '/' || szBuffer[ 0 ] == ';' )
  568.                         continue;
  569.                        
  570.                 parse( szBuffer, szSongName2,63, szSongTime2,63, szSongAuthor2, 63, szSongFile2, 63, szSongFile2, 63)
  571.                
  572.                 remove_quotes( szSongName2 )
  573.                 remove_quotes( szSongTime2 )
  574.                 remove_quotes( szSongAuthor2 )
  575.                 remove_quotes( szSongFile2 )
  576.        
  577.                 precache_sound( szSongFile2 )
  578.                
  579.                 log_amx( "Song Name: %s, Song Time: %s, Song Author: %s, Song File: %s", szSongName2, szSongTime2, szSongAuthor2, szSongFile2 )
  580.                
  581.                 ArrayPushString( g_aSongName2, szSongName2 )
  582.                 ArrayPushString( g_aSongTime2, szSongTime2 )
  583.                 ArrayPushString( g_aSongAuthor2, szSongAuthor2 )
  584.                 ArrayPushString( g_aSongFile2, szSongFile2 )
  585.                
  586.                 ++g_iHipSongs
  587.         }
  588.        
  589.         if( !g_iHipSongs )
  590.         {
  591.                 log_amx( "No Songs were found!" )
  592.                 return 1;
  593.         }
  594.        
  595.         else
  596.         {
  597.                 log_amx( "Total Songs Loaded: %i", g_iHipSongs )
  598.         }
  599.        
  600.         return 1;
  601. }
  602.  
  603. ReadFile3( ) // Dubstep
  604. {
  605.         g_aSongName3 = ArrayCreate( 64, 1 )
  606.         g_aSongTime3 = ArrayCreate( 64, 1 )
  607.         g_aSongAuthor3 = ArrayCreate( 64, 1 )
  608.         g_aSongFile3 = ArrayCreate( 64, 1 )
  609.        
  610.         get_configsdir( szConfigsDir, charsmax( szConfigsDir ) )
  611.        
  612.         add( szConfigsDir, charsmax( szConfigsDir ), "/Songs/Dubstep.ini" )
  613.        
  614.         if( !file_exists( szConfigsDir ) )
  615.         {
  616.                 write_file( szConfigsDir, "; Here You Add Dubstep Song" )
  617.         write_file( szConfigsDir, "; folder/Dupstep/song.mp3 // no needed sound/ !")
  618.                 write_file( szConfigsDir, "; ^"First Of The Year^" ^"3:14^" ^"Skrillex^" ^"music/Dubstep/Timber.mp3^"" )
  619.                 log_amx( "No Songs were found!" )
  620.                 pause( "a" )
  621.                 return 1;
  622.         }
  623.        
  624.         new iFile = fopen( szConfigsDir, "rt" )
  625.        
  626.         if( !iFile )
  627.                 return 0;
  628.                
  629.         new szBuffer[ 512 ], szSongName3[ 64 ], szSongTime3[ 64 ], szSongAuthor3[ 64 ], szSongFile3[ 64 ]
  630.                
  631.         while( !feof( iFile ) )
  632.         {
  633.                 fgets( iFile, szBuffer, charsmax( szBuffer ) )
  634.                
  635.                 replace( szBuffer, charsmax( szBuffer ), "^n", "" )
  636.                
  637.                 if( !szBuffer[ 0 ] || szBuffer[ 0 ] == '/' || szBuffer[ 0 ] == ';' )
  638.                         continue;
  639.                        
  640.                 parse( szBuffer, szSongName3,63, szSongTime3,63, szSongAuthor3, 63, szSongFile3, 63)
  641.                
  642.                 remove_quotes( szSongName3 )
  643.                 remove_quotes( szSongTime3 )
  644.                 remove_quotes( szSongAuthor3 )
  645.                 remove_quotes( szSongFile3 )
  646.  
  647.                 precache_sound( szSongFile3 )
  648.  
  649.                 log_amx( "Song Name: %s, Song Time: %s, Song Author: %s, Song File: %s", szSongName3, szSongTime3, szSongAuthor3, szSongFile3 )
  650.                
  651.                 ArrayPushString( g_aSongName3, szSongName3 )
  652.                 ArrayPushString( g_aSongTime3, szSongTime3 )
  653.                 ArrayPushString( g_aSongAuthor3, szSongAuthor3 )
  654.                 ArrayPushString( g_aSongFile3, szSongFile3 )
  655.                
  656.                 ++g_iDubSongs
  657.         }
  658.        
  659.         if( !g_iDubSongs )
  660.         {
  661.                 log_amx( "No Songs were found!" )
  662.                 return 1;
  663.         }
  664.        
  665.         else
  666.         {
  667.                 log_amx( "Total Songs Loaded: %i", g_iDubSongs )
  668.         }
  669.        
  670.         return 1;
  671. }
  672.  
  673. ReadFile4( ) // Mizrhit
  674. {
  675.         g_aSongName4 = ArrayCreate( 64, 1 )
  676.         g_aSongTime4 = ArrayCreate( 64, 1 )
  677.         g_aSongAuthor4 = ArrayCreate( 64, 1 )
  678.         g_aSongFile4 = ArrayCreate( 64, 1 )
  679.    
  680.         get_configsdir( szConfigsDir, charsmax( szConfigsDir ) )
  681.        
  682.         add( szConfigsDir, charsmax( szConfigsDir ), "/Songs/Mizrhit.ini" )
  683.        
  684.         if( !file_exists( szConfigsDir ) )
  685.         {
  686.                 write_file( szConfigsDir, "; Here You Add Mizrhit Song" )
  687.         write_file( szConfigsDir, "; folder/Mizrhit/song.mp3 // no needed sound/ !")
  688.                 write_file( szConfigsDir, "; ^"At^" ^"3:20^" ^"Eyal Golan^" ^"music/Mizrhit/At.mp3^"" )
  689.                 log_amx( "No Songs were found!" )
  690.                 pause( "a" )
  691.                 return 1;
  692.         }
  693.        
  694.         new iFile = fopen( szConfigsDir, "rt" )
  695.        
  696.         if( !iFile )
  697.                 return 0;
  698.                
  699.         new szBuffer[ 512 ], szSongName4[ 64 ], szSongTime4[ 64 ], szSongAuthor4[ 64 ], szSongFile4[ 64 ]
  700.                
  701.         while( !feof( iFile ) )
  702.         {
  703.                 fgets( iFile, szBuffer, charsmax( szBuffer ) )
  704.                
  705.                 replace( szBuffer, charsmax( szBuffer ), "^n", "" )
  706.                
  707.                 if( !szBuffer[ 0 ] || szBuffer[ 0 ] == '/' || szBuffer[ 0 ] == ';' )
  708.                         continue;
  709.                        
  710.                 parse( szBuffer, szSongName4,63, szSongTime4,63, szSongAuthor4, 63, szSongFile4, 63)
  711.                
  712.                 remove_quotes( szSongName4 )
  713.                 remove_quotes( szSongTime4 )
  714.                 remove_quotes( szSongAuthor4 )
  715.                 remove_quotes( szSongFile4 )
  716.        
  717.                 precache_sound( szSongFile4 )
  718.  
  719.                 log_amx( "Song Name: %s, Song Time: %s, Song Author: %s, Song File: %s", szSongName4, szSongTime4, szSongAuthor4, szSongFile4 )
  720.                
  721.                 ArrayPushString( g_aSongName4, szSongName4 )
  722.                 ArrayPushString( g_aSongTime4, szSongTime4 )
  723.                 ArrayPushString( g_aSongAuthor4, szSongAuthor4 )
  724.                 ArrayPushString( g_aSongFile4, szSongFile4 )
  725.                
  726.                 ++g_iMizSongs
  727.         }
  728.    
  729.     if( !g_iMizSongs )
  730.     {
  731.         log_amx( "No Songs were found!" )
  732.         return 1;
  733.     }
  734.     else
  735.     {
  736.         log_amx( "Total Songs Loaded: %i", g_iMizSongs )
  737.     }
  738.    
  739.     return 1;
  740. }
  741.  
  742. stock ColorChat(const id, const string[], {Float, Sql, Resul,_}:...)
  743. {
  744.     new msg[191], players[32], count = 1;
  745.    
  746.     static len
  747.     len = formatex(msg, charsmax(msg), "^4[^1 %s^4 ]^1 ", szPrefix )
  748.     vformat(msg[len], charsmax(msg) - len, string, 3)
  749.    
  750.     if(id)
  751.         players[0] = id;
  752.     else
  753.         get_players(players,count,"ch")
  754.    
  755.     for (new i = 0; i < count; i++)
  756.     {
  757.         if(is_user_connected(players[i]))
  758.         {
  759.             message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"),_, players[i])
  760.             write_byte(players[i])
  761.             write_string(msg)
  762.             message_end()
  763.         }
  764.     }
  765.     return;
  766. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top