HTTP Downloader v1.0
Description
Allows server to download files from the web.
Useful for plugins that need auto-updater.
Requirements
- Amx Mod X 1.76 or greater
- Sockets module
Note: default download limit is 10. to change it open include/httpdl.inc and change the value of MAX_DOWNLOADS then recompile then plugin.
Example
PHP Code:
#include <amxmodx>
#include <httpdl>
public plugin_init() {
register_clcmd("say /dl", "test");
}
public test(id) {
new dlid = download("http://google.com/", "addons/amxmodx/data/google.txt");
}
// Called when file is downloaded
public dlcomplete(id, file[]) {
server_print("Downloaded (id: %d) %s", id, file);
}
下载地址 http://forums.alliedmods.net/showthread.php?p=551998 |