|
@@ -2,13 +2,13 @@
|
|
|
|
|
|
#include <sourcemod>
|
|
#include <sourcemod>
|
|
#include <sdktools>
|
|
#include <sdktools>
|
|
-#include <steamtools>
|
|
|
|
|
|
+#include <steampawn>
|
|
|
|
|
|
#undef REQUIRE_PLUGIN
|
|
#undef REQUIRE_PLUGIN
|
|
#tryinclude <updater>
|
|
#tryinclude <updater>
|
|
|
|
|
|
#define UPDATE_URL "http://hg.doctormckay.com/public-plugins/raw/default/automatic_steam_update.txt"
|
|
#define UPDATE_URL "http://hg.doctormckay.com/public-plugins/raw/default/automatic_steam_update.txt"
|
|
-#define PLUGIN_VERSION "1.9.1"
|
|
|
|
|
|
+#define PLUGIN_VERSION "2.0.0"
|
|
|
|
|
|
#define ALERT_SOUND "ui/system_message_alert.wav"
|
|
#define ALERT_SOUND "ui/system_message_alert.wav"
|
|
|
|
|
|
@@ -64,7 +64,10 @@ public OnPluginStart() {
|
|
hudRCvar = CreateConVar("auto_steam_update_hud_text_red", "0", "Amount of red for the HUD timer (only on supported games)", _, true, 0.0, true, 255.0);
|
|
hudRCvar = CreateConVar("auto_steam_update_hud_text_red", "0", "Amount of red for the HUD timer (only on supported games)", _, true, 0.0, true, 255.0);
|
|
hudGCvar = CreateConVar("auto_steam_update_hud_text_green", "255", "Amount of red for the HUD timer (only on supported games)", _, true, 0.0, true, 255.0);
|
|
hudGCvar = CreateConVar("auto_steam_update_hud_text_green", "255", "Amount of red for the HUD timer (only on supported games)", _, true, 0.0, true, 255.0);
|
|
hudBCvar = CreateConVar("auto_steam_update_hud_text_blue", "0", "Amount of red for the HUD timer (only on supported games)", _, true, 0.0, true, 255.0);
|
|
hudBCvar = CreateConVar("auto_steam_update_hud_text_blue", "0", "Amount of red for the HUD timer (only on supported games)", _, true, 0.0, true, 255.0);
|
|
|
|
+
|
|
|
|
+ #if defined _updater_included
|
|
updaterCvar = CreateConVar("auto_steam_update_auto_update", "1", "Enables automatic plugin updating (has no effect if Updater is not installed)");
|
|
updaterCvar = CreateConVar("auto_steam_update_auto_update", "1", "Enables automatic plugin updating (has no effect if Updater is not installed)");
|
|
|
|
+ #endif
|
|
|
|
|
|
sv_password = FindConVar("sv_password");
|
|
sv_password = FindConVar("sv_password");
|
|
|
|
|
|
@@ -102,9 +105,8 @@ public OnClientPostAdminCheck(client) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-public Action:Steam_RestartRequested() {
|
|
|
|
|
|
+public void SteamPawn_OnRestartRequested() {
|
|
startTimer();
|
|
startTimer();
|
|
- return Plugin_Continue;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public Action:Command_ForceRestart(client, args) {
|
|
public Action:Command_ForceRestart(client, args) {
|
|
@@ -226,6 +228,7 @@ IsServerPopulated() {
|
|
|
|
|
|
public OnAllPluginsLoaded() {
|
|
public OnAllPluginsLoaded() {
|
|
new Handle:convar;
|
|
new Handle:convar;
|
|
|
|
+ #if defined _updater_included
|
|
if(LibraryExists("updater")) {
|
|
if(LibraryExists("updater")) {
|
|
Updater_AddPlugin(UPDATE_URL);
|
|
Updater_AddPlugin(UPDATE_URL);
|
|
new String:newVersion[10];
|
|
new String:newVersion[10];
|
|
@@ -234,6 +237,9 @@ public OnAllPluginsLoaded() {
|
|
} else {
|
|
} else {
|
|
convar = CreateConVar("auto_steam_update_version", PLUGIN_VERSION, "Automatic Steam Update Version", FCVAR_DONTRECORD|FCVAR_NOTIFY|FCVAR_CHEAT);
|
|
convar = CreateConVar("auto_steam_update_version", PLUGIN_VERSION, "Automatic Steam Update Version", FCVAR_DONTRECORD|FCVAR_NOTIFY|FCVAR_CHEAT);
|
|
}
|
|
}
|
|
|
|
+ #else
|
|
|
|
+ convar = CreateConVar("auto_steam_update_version", PLUGIN_VERSION, "Automatic Steam Update Version", FCVAR_DONTRECORD|FCVAR_NOTIFY|FCVAR_CHEAT);
|
|
|
|
+ #endif
|
|
HookConVarChange(convar, Callback_VersionConVarChanged);
|
|
HookConVarChange(convar, Callback_VersionConVarChanged);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -241,6 +247,7 @@ public Callback_VersionConVarChanged(Handle:convar, const String:oldValue[], con
|
|
ResetConVar(convar);
|
|
ResetConVar(convar);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+#if defined _updater_included
|
|
public Action:Updater_OnPluginDownloading() {
|
|
public Action:Updater_OnPluginDownloading() {
|
|
if(!GetConVarBool(updaterCvar)) {
|
|
if(!GetConVarBool(updaterCvar)) {
|
|
return Plugin_Handled;
|
|
return Plugin_Handled;
|
|
@@ -256,4 +263,5 @@ public OnLibraryAdded(const String:name[]) {
|
|
|
|
|
|
public Updater_OnPluginUpdated() {
|
|
public Updater_OnPluginUpdated() {
|
|
ReloadPlugin();
|
|
ReloadPlugin();
|
|
-}
|
|
|
|
|
|
+}
|
|
|
|
+#endif
|