diff --git a/advertisements/scripting/advertisements.sp b/Advertisements/scripting/Advertisements.sp similarity index 95% rename from advertisements/scripting/advertisements.sp rename to Advertisements/scripting/Advertisements.sp index a2d01c61..a8ec31c5 100644 --- a/advertisements/scripting/advertisements.sp +++ b/Advertisements/scripting/Advertisements.sp @@ -1,7 +1,6 @@ #include #include #undef REQUIRE_PLUGIN -#include #include "include/topcolors.sp" #pragma newdecls required @@ -50,10 +49,6 @@ public void OnPluginStart() RegServerCmd("sm_advertisements_reload", Command_ReloadAds, "Reload the advertisements"); AddTopColors(); - - if (LibraryExists("updater")) { - Updater_AddPlugin(UPDATE_URL); - } } public void OnMapStart() @@ -65,14 +60,14 @@ public void OnMapStart() public Action Timer_DisplayAd(Handle timer) { - if (!g_hEnabled.BoolValue) { + if (!g_hEnabled.BoolValue) { return Plugin_Handled; } - Timer_DisplayAdRegulars(); - Timer_DisplayAdVIP(); + Timer_DisplayAdRegulars(); + Timer_DisplayAdVIP(); - return Plugin_Continue; + return Plugin_Continue; } public bool IsVIP(int client) @@ -83,13 +78,6 @@ public bool IsVIP(int client) return false; } -public void OnLibraryAdded(const char[] name) -{ - if (StrEqual(name, "updater")) { - Updater_AddPlugin(UPDATE_URL); - } -} - public void ConVarChange_File(ConVar convar, const char[] oldValue, const char[] newValue) { ParseAds(); @@ -369,11 +357,11 @@ void ParseAds() g_hAdvertisementsRegular = CreateKeyValues("AdvertisementsRegular"); g_hAdvertisementsVIP = CreateKeyValues("AdvertisementsVIP"); - char sFileRegular[64], sPath[PLATFORM_MAX_PATH]; - char sFileVIP[64]; - g_hFileRegular.GetString(sFileRegular, sizeof(sFileRegular)); - g_hFileVIP.GetString(sFileVIP, sizeof(sFileVIP)); - BuildPath(Path_SM, sPath, sizeof(sPath), "configs/%s", sFileRegular); + char sFileRegular[64], sPath[PLATFORM_MAX_PATH]; + char sFileVIP[64]; + g_hFileRegular.GetString(sFileRegular, sizeof(sFileRegular)); + g_hFileVIP.GetString(sFileVIP, sizeof(sFileVIP)); + BuildPath(Path_SM, sPath, sizeof(sPath), "configs/%s", sFileRegular); if (!FileExists(sPath)) { SetFailState("File Not Found: %s", sPath); @@ -455,4 +443,4 @@ void ProcessVariables(char sText[1024]) iStart += iStart2 + 1; } -} \ No newline at end of file +} diff --git a/advertisements/scripting/include/colorvariables.inc b/Advertisements/scripting/include/colorvariables.inc similarity index 100% rename from advertisements/scripting/include/colorvariables.inc rename to Advertisements/scripting/include/colorvariables.inc diff --git a/advertisements/scripting/include/topcolors.sp b/Advertisements/scripting/include/topcolors.sp similarity index 100% rename from advertisements/scripting/include/topcolors.sp rename to Advertisements/scripting/include/topcolors.sp diff --git a/advertisements/scripting/include/updater.inc b/advertisements/scripting/include/updater.inc deleted file mode 100644 index 68851328..00000000 --- a/advertisements/scripting/include/updater.inc +++ /dev/null @@ -1,97 +0,0 @@ -#if defined _updater_included - #endinput -#endif -#define _updater_included - -/** - * Adds your plugin to the updater. The URL will be updated if - * your plugin was previously added. - * - * @param url URL to your plugin's update file. - * @noreturn - */ -native Updater_AddPlugin(const String:url[]); - -/** - * Removes your plugin from the updater. This does not need to - * be called during OnPluginEnd. - * - * @noreturn - */ -native Updater_RemovePlugin(); - -/** - * Forces your plugin to be checked for updates. The behaviour - * of the update is dependant on the server's configuration. - * - * @return True if an update was triggered. False otherwise. - * @error Plugin not found in updater. - */ -native bool:Updater_ForceUpdate(); - -/** - * Called when your plugin is about to be checked for updates. - * - * @return Plugin_Handled to prevent checking, Plugin_Continue to allow it. - */ -forward Action:Updater_OnPluginChecking(); - -/** - * Called when your plugin is about to begin downloading an available update. - * - * @return Plugin_Handled to prevent downloading, Plugin_Continue to allow it. - */ -forward Action:Updater_OnPluginDownloading(); - -/** - * Called when your plugin's update files have been fully downloaded - * and are about to write to their proper location. This should be used - * to free read-only resources that require write access for your update. - * - * @note OnPluginUpdated will be called later during the same frame. - * - * @noreturn - */ -forward Updater_OnPluginUpdating(); - -/** - * Called when your plugin's update has been completed. It is safe - * to reload your plugin at this time. - * - * @noreturn - */ -forward Updater_OnPluginUpdated(); - -/** - * @brief Reloads a plugin. - * - * @param plugin Plugin Handle (INVALID_HANDLE uses the calling plugin). - * @noreturn - */ -stock ReloadPlugin(Handle:plugin=INVALID_HANDLE) -{ - decl String:filename[64]; - GetPluginFilename(plugin, filename, sizeof(filename)); - ServerCommand("sm plugins reload %s", filename); -} - - -public SharedPlugin:__pl_updater = -{ - name = "updater", - file = "updater.smx", -#if defined REQUIRE_PLUGIN - required = 1, -#else - required = 0, -#endif -}; - -#if !defined REQUIRE_PLUGIN -public __pl_updater_SetNTVOptional() -{ - MarkNativeAsOptional("Updater_AddPlugin"); - MarkNativeAsOptional("Updater_RemovePlugin"); - MarkNativeAsOptional("Updater_ForceUpdate"); -} -#endif \ No newline at end of file