
Plugin robi autoupdate pluginom które mają kod podany poniżej

sm_autoupdate_binary (1[/b]) - Pobieranie binaries sm_autoupdate_source (1) - Pobieranie source sm_autoupdate_gamedata (1) - Pobieranie gamedata files sm_autoupdate_other (1) - Pobieranie innych plików sm_autoupdate_backup (1)- Zapisanie kopi zapasowej starej wersji, 1=włączone, zapis do pliku[b] addons/sourcemod/plugins/disabled/backups

sm_autoupdate_check [nazwapliku/idx] - Sprawdza czy są UPDATE, lecz ich nie pobiera. (logi w sourcemod/logs/autoupdate.log) sm_autoupdate_download [nazwapliku/idx] - Sprawdza czy jest UPDATE i pobiera je. Pozostaw puste IDX aby pobrać wszystkie. (logs results to sourcemod/logs/autoupdate.log) sm_autoupdate_list - Lista pokazująca które będą zaktualizowanie. sm_autoupdate_rem <nazwapliku/idx> - Stops a plugin being autoupdated. Get idx from sm_autoupdate_list. (NIE WIEM OCB. ZA BARDZO <img src='http://img.amxx.pl/public/style_emoticons/<#EMO_DIR#>/kwasny.gif' class='bbc_emoticon' alt=':/' /> ) sm_autoupdate_block_add <nazwapliku> - Dodanie do list zablokowanych pluginów. Pluginy z listy nie będą pobierane. (np. sm_autoupdate_block_add autoupdate.smx) sm_autoupdate_block_rem <nazwapliku/idx> - Usunięcie z losty zablokowany pluginów pluginu. sm_autoupdate_block_list - Lista pluginów zablokowana.
Jak zrobić aby twój plugin też mógł sam się zaktualizować?
#pragma semicolon 1
#include <sourcemod>
#undef REQUIRE_PLUGIN
#include <autoupdate>
#define PL_VERSION "1.0"
public OnPluginStart() {
RegConsoleCmd("testau", Command_test);
}
public OnAllPluginsLoaded() {
if(LibraryExists("pluginautoupdate")) {
// only register myself if the autoupdater is loaded
// AutoUpdate_AddPlugin(const String:url[], const String:file[], const String:version[])
AutoUpdate_AddPlugin("127.0.0.1", "/plugins.xml", PL_VERSION);
}
}
public OnPluginEnd() {
if(LibraryExists("pluginautoupdate")) {
// I don't need updating anymore
// AutoUpdate_RemovePlugin(Handle:plugin=INVALID_HANDLE) - don't specifiy plugin to remove calling plugin
AutoUpdate_RemovePlugin();
}
}
public Action:Command_test(client, args) {
PrintToChatAll("Version %s", PL_VERSION);
}
127.0.0.1/plugins.xml powinien wyglądać tak:
<version>1.1</version> <changes>Changed version number.</changes> <binary>/auexample.smx</binary> <source>/auexample.sp</source> <gamedata>/folder/auexample.games.txt</gamedata> <other dir="newdir">/newfile.txt,/folder/newfile2.txt</other> <other dir="newdir2">/newfile3.txt</other>
Załączone pliki
Użytkownik Kusek edytował ten post 19.08.2011 09:35
code, nie quote :p