HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2.  
  3. #define PLUGIN_NAME "Multi FastDL"
  4. #define PLUGIN_VERSION "1.2"
  5. #define PLUGIN_AUTHOR "JoRoPiTo"
  6.  
  7. #define PLUGIN_CONFIG "multifastdl.ini"
  8. #define MAX_URL 32
  9.  
  10. new g_last
  11. new g_total
  12. new g_url[MAX_URL][128]
  13. new gp_downloadurl
  14.  
  15. public plugin_init()
  16. {
  17. register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
  18.  
  19. gp_downloadurl = get_cvar_pointer("sv_downloadurl")
  20.  
  21. new cfgdir[32], cfgfile[128], line[128]
  22. get_localinfo("amxx_configsdir", cfgdir, charsmax(cfgdir));
  23. formatex(cfgfile, charsmax(cfgfile), "%s/%s", cfgdir, PLUGIN_CONFIG)
  24. new f = fopen(cfgfile, "rt")
  25. while(!feof(f)) {
  26. new tmp[8]
  27. if(g_total == MAX_URL) break
  28.  
  29. fgets(f, line, charsmax(line))
  30. trim(line)
  31.  
  32. if(!equali(line, "http://", 7)) continue
  33.  
  34. copy(g_url[g_total], 127, line)
  35. g_total++
  36. }
  37. g_total--
  38. fclose(f)
  39. }
  40.  
  41. public client_connect(id)
  42. {
  43. g_last = (g_last < g_total) ? g_last + 1 : 0
  44. set_pcvar_string(gp_downloadurl, g_url[g_last])
  45. }
  46.