#pragma semicolon 1 #pragma newdecls required #include #include #include #undef REQUIRE_PLUGIN #tryinclude #define REQUIRE_PLUGIN #define VOTE_NO "###no###" #define VOTE_YES "###yes###" #define PLUGIN_TAG "{green}[Extend]" // Largest mp_timelimit we allow; floats are exact up to 2^24 and the engine also converts it to int #define MAX_TIMELIMIT_MINUTES 16777216.0 int g_iNumAttempts = 0; int g_iExtendCount = 0; int g_iExtendTime = 0; float g_fVoteRequired = 0.0; ConVar g_cvarExtendVoteTime; ConVar g_cvarExtendVoteMaxDuration; ConVar g_cvarExtendVotePercent; ConVar g_cvarExtendVotePercentIncrement; ConVar g_cvarExtendVotePercentMax; ConVar g_cvarExtendVoteMaxFailedAttempt; ConVar g_cvarExtendVote; ConVar g_cvarMpMaxRounds; ConVar g_cvarMpFragLimit; ConVar g_cvarMpWinLimit; ConVar g_cvarMpTimeLimit; ConVar g_cvarRequireAllExtends; bool g_bCanCancelGameOver = false; Address g_pGameOver; public Plugin myinfo = { name = "Map Extend Tools", author = "Obus, BotoX, .Rushaway, koen", description = "Adds map extension commands.", version = "1.4.5", url = "" }; public void OnPluginStart() { LoadTranslations("common.phrases"); LoadTranslations("basevotes.phrases"); LoadTranslations("extend.phrases"); g_cvarMpMaxRounds = FindConVar("mp_maxrounds"); g_cvarMpFragLimit = FindConVar("mp_fraglimit"); g_cvarMpWinLimit = FindConVar("mp_winlimit"); g_cvarMpTimeLimit = FindConVar("mp_timelimit"); g_cvarExtendVote = CreateConVar("sm_extendvote_enabled", "1", "Enable Extend Vote? [1 = Enable | 0 = Disable]", FCVAR_NONE, true, 0.0, true, 1.0); g_cvarExtendVoteTime = CreateConVar("sm_extendvote_time", "15", "Time that will be added to mp_timelimit shall the extend vote succeed", FCVAR_NONE, true, 1.0); g_cvarExtendVoteMaxDuration = CreateConVar("sm_extendvote_max_duration", "30", "Maximum minutes an admin can request with \"sm_voteextend