hlmod.hu
https://hlmod.hu/

Multi Gyors Letöltés
https://hlmod.hu/viewtopic.php?f=9&t=13485
Oldal: 1 / 1

Szerző:  Tomos [2013.12.26. 10:00 ]
Hozzászólás témája:  Multi Gyors Letöltés

Valaki ezt át tudná írni úgy hogy ne a multifastdl.ini böl olvassa a linket hanem az sma-ba lehessen beleírni.

SMA Forráskód: [ Mindet kijelol ]
  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.  

Szerző:  NeverDying [2013.12.26. 12:45 ]
Hozzászólás témája:  Re: Multi Gyors Letöltés

Az miért lenne jó, hogy akárhányszor amikor új letöltési linket akarsz hozzá adni akkor újra kelljen majd fordítani az sma-t? :D
Sztem az ini kényelmesebb. o.O

//*elnézést a belepofázásért:)*//

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/