Both .sp files failed to compile. The reason is that you didn't parenthesize the values that you were using the view_as operator for.
Before: view_as<something>something2
After: view_as<something>(something2)
I also replaced all the "FCVAR_PLUGIN" plugin stuff with an underscore since they're deprecated.
Another thing I did was add #pragma newdecls required to both plugins. For acs.sp, you didn't add "void" for the ConVar.AddChangeHook callbacks and other things like OnMapStart and OnPluginStart. You also didn't add "int" for the MenuHandler.
Before: public VoteMenuHandler
After: public int VoteMenuHandler
Aside from that, everything checks out so far, though I do see a lot of hard-coded stuff that could easily be shortened/fixed by Silvers' suggestion. I second his suggestion since it really will reduce all those mutations to like around 25-30 lines of code and will support all mutations including custom ones.
This is the one that Silvers is suggesting.
PHP Code:
int g_iCurrentMode;
bool IsAllowedGameMode()
{
if( g_hCvarMPGameMode == null )
return false;
int iCvarModesTog = g_hCvarModesTog.IntValue;
if( iCvarModesTog != 0 )
{
g_iCurrentMode = 0;
int entity = CreateEntityByName("info_gamemode");
DispatchSpawn(entity);
HookSingleEntityOutput(entity, "OnCoop", OnGamemode, true);
HookSingleEntityOutput(entity, "OnSurvival", OnGamemode, true);
HookSingleEntityOutput(entity, "OnVersus", OnGamemode, true);
HookSingleEntityOutput(entity, "OnScavenge", OnGamemode, true);
ActivateEntity(entity);
AcceptEntityInput(entity, "PostSpawnActivate");
AcceptEntityInput(entity, "Kill");
if( g_iCurrentMode == 0 )
return false;
if( !(iCvarModesTog & g_iCurrentMode) )
return false;
}
char sGameModes[64], sGameMode[64];
g_hCvarMPGameMode.GetString(sGameMode, sizeof(sGameMode));
Format(sGameMode, sizeof(sGameMode), ",%s,", sGameMode);
g_hCvarModes.GetString(sGameModes, sizeof(sGameModes));
if( strcmp(sGameModes, "") )
{
Format(sGameModes, sizeof(sGameModes), ",%s,", sGameModes);
if( StrContains(sGameModes, sGameMode, false) == -1 )
return false;
}
g_hCvarModesOff.GetString(sGameModes, sizeof(sGameModes));
if( strcmp(sGameModes, "") )
{
Format(sGameModes, sizeof(sGameModes), ",%s,", sGameModes);
if( StrContains(sGameModes, sGameMode, false) != -1 )
return false;
}
return true;
}
public void OnGamemode(const char[] output, int caller, int activator, float delay)
{
if( strcmp(output, "OnCoop") == 0 )
g_iCurrentMode = 1;
else if( strcmp(output, "OnSurvival") == 0 )
g_iCurrentMode = 2;
else if( strcmp(output, "OnVersus") == 0 )
g_iCurrentMode = 4;
else if( strcmp(output, "OnScavenge") == 0 )
g_iCurrentMode = 8;
}
Make sure to call it anytime after the round starts since it creates the info_gamemode entity and you'll get errors if you try to create it on OnMapStart or anything before configs are executed. I highly recommend checking out his plugins, like Mutant Zombies and Gun Cabinet since he calls the check on OnConfigsExecuted. A lot of his plugins contain code that not many users know about or tried before so maybe they can help you optimize your plugins.