now having 3 map nominations as a tier perk
This commit is contained in:
parent
3d7e279cc7
commit
fefad5ce8a
@ -171,6 +171,7 @@ ConVar g_Cvar_ShufflePerClient;
|
||||
ConVar g_Cvar_NoRestrictionTimeframeEnable;
|
||||
ConVar g_Cvar_NoRestrictionTimeframeMinTime;
|
||||
ConVar g_Cvar_NoRestrictionTimeframeMaxTime;
|
||||
ConVar g_Cvar_MultipleNominationsTier;
|
||||
|
||||
/* Mapchooser Extended Data Handles */
|
||||
Handle g_OfficialList = INVALID_HANDLE;
|
||||
@ -318,6 +319,7 @@ public void OnPluginStart()
|
||||
g_Cvar_NoRestrictionTimeframeEnable = CreateConVar("mce_no_restriction_timeframe_enable", "1", "Enable timeframe where all nomination restrictions and cooldowns are disabled?", _, true, 0.0, true, 1.0);
|
||||
g_Cvar_NoRestrictionTimeframeMinTime = CreateConVar("mce_no_restriction_timeframe_mintime", "0100", "Start of the timeframe where all nomination restrictions and cooldowns are disabled (Format: HHMM)", _, true, 0000.0, true, 2359.0);
|
||||
g_Cvar_NoRestrictionTimeframeMaxTime = CreateConVar("mce_no_restriction_timeframe_maxtime", "0700", "End of the timeframe where all nomination restrictions and cooldowns are disabled (Format: HHMM)", _, true, 0000.0, true, 2359.0);
|
||||
g_Cvar_MultipleNominationsTier = CreateConVar("mce_multiple_nominations_tier", "3", "Tier required for having multiple nominations available.");
|
||||
|
||||
RegAdminCmd("sm_mapvote", Command_Mapvote, ADMFLAG_CHANGEMAP, "sm_mapvote - Forces MapChooser to attempt to run a map vote now.");
|
||||
RegAdminCmd("sm_setnextmap", Command_SetNextmap, ADMFLAG_CHANGEMAP, "sm_setnextmap <map>");
|
||||
@ -2208,8 +2210,12 @@ NominateResult InternalNominateMap(char[] map, int owner)
|
||||
|
||||
/* Look to replace an existing nomination by this client - Nominations made with owner = 0 arent replaced */
|
||||
//2023 edit: change clients first nomination out of the clients multiple nominations, make a check if client filled all his nomination slots
|
||||
//currently hard coded to 3 maps, just add a cvar to replace it with in the future
|
||||
if(owner && GetArraySize(g_NominateList[owner]) > 2)
|
||||
//2026 edit: using tier to determine if 3 nominations or just 1
|
||||
int tier_required = GetConVarInt(g_Cvar_MultipleNominationsTier);
|
||||
int client_tier = GetPlayerTier_native(owner);
|
||||
int nom_capacity = tier_required > client_tier ? 0 : 2; //1 nomination or 3 nominations.
|
||||
|
||||
if(owner && GetArraySize(g_NominateList[owner]) > nom_capacity)
|
||||
{
|
||||
char oldmap[PLATFORM_MAX_PATH];
|
||||
GetArrayString(g_NominateList[owner], 0, oldmap, PLATFORM_MAX_PATH);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user