Switch base plugins to APL2; disable nextmap for L4D, Dystopia, Synergy (bugs 3716, 3687, 3741; r=pred)

This commit is contained in:
Fyren 2009-03-18 22:10:39 -07:00
parent d7917a6a9a
commit 4364ba46e2
3 changed files with 22 additions and 16 deletions

View File

@ -61,13 +61,13 @@ new TopMenuObject:obj_votingcmds = INVALID_TOPMENUOBJECT;
#include "adminmenu/dynamicmenu.sp"
public bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max)
public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
{
CreateNative("GetAdminTopMenu", __GetAdminTopMenu);
CreateNative("AddTargetsToMenu", __AddTargetsToMenu);
CreateNative("AddTargetsToMenu2", __AddTargetsToMenu2);
RegPluginLibrary("adminmenu");
return true;
return APLRes_Success;
}
public OnPluginStart()

View File

@ -159,7 +159,7 @@ public OnPluginStart()
g_NominationsResetForward = CreateGlobalForward("OnNominationRemoved", ET_Ignore, Param_String, Param_Cell);
}
public bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max)
public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
{
RegPluginLibrary("mapchooser");
@ -170,7 +170,7 @@ public bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max)
CreateNative("GetExcludeMapList", Native_GetExcludeMapList);
CreateNative("EndOfMapVoteEnabled", Native_EndOfMapVoteEnabled);
return true;
return APLRes_Success;
}
public OnConfigsExecuted()

View File

@ -51,14 +51,26 @@ new Handle:g_MapList = INVALID_HANDLE;
new g_MapListSerial = -1;
new g_CurrentMapStartTime;
public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
{
decl String:game[128];
GetGameFolderName(game, sizeof(game));
if (StrEqual(game, "left4dead", false)
|| StrEqual(game, "dystopia", false)
|| StrEqual(game, "synergy", false))
{
strcopy(error, err_max, "Nextmap is incompatible with this game");
return APLRes_SilentFailure;
}
return APLRes_Success;
}
public OnPluginStart()
{
decl String:desc[128];
GetGameFolderName(desc, sizeof(desc));
if (StrEqual(desc, "left4dead", false))
return;
LoadTranslations("common.phrases");
LoadTranslations("nextmap.phrases");
@ -81,12 +93,6 @@ public OnMapStart()
public OnConfigsExecuted()
{
decl String:desc[128];
GetGameFolderName(desc, sizeof(desc));
if (StrEqual(desc, "left4dead", false))
return;
decl String:lastMap[64], String:currentMap[64];
GetNextMap(lastMap, sizeof(lastMap));
GetCurrentMap(currentMap, 64);