Page 1 of 1

HTTP Downloader

Posted: Mon Nov 22, 2021 10:20 am
by greenie
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
#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);
}
.zip