updated so that low pop helper has its own configuration now in the .cfg to decide with how many people on each map to help with easy settings

This commit is contained in:
jenz
2026-04-19 19:34:58 +02:00
parent 4a1ac398d0
commit c57aa5bcc2
3 changed files with 43 additions and 27 deletions
@@ -114,6 +114,7 @@ native bool ExcludeMapListingPriority(const char[] map, int index);
native int GetMapCooldown(const char[] map);
native int GetMapCooldownTime(const char[] map); // in unix time
native int GetMapCooldownTime2(const char[] map); // in unix time
native int GetMapLowPopHelpCount(const char[] map);
native int GetMapMinTime(const char[] map);
native int GetMapMaxTime(const char[] map);
native int GetMapMinPlayers(const char[] map);
@@ -473,6 +473,7 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
CreateNative("GetMapCooldown", Native_GetMapCooldown);
CreateNative("GetMapCooldownTime", Native_GetMapCooldownTime);
CreateNative("GetMapCooldownTime2", Native_GetMapCooldownTime2);
CreateNative("GetMapLowPopHelpCount", Native_GetMapLowPopHelpCount);
CreateNative("GetMapMinTime", Native_GetMapMinTime);
CreateNative("GetMapMaxTime", Native_GetMapMaxTime);
CreateNative("GetMapMinPlayers", Native_GetMapMinPlayers);
@@ -2745,6 +2746,27 @@ public int Native_GetMapCooldownTime2(Handle plugin, int numParams)
return InternalGetMapCooldownTime2(map);
}
//GetMapLowPopHelpCount
public int Native_GetMapLowPopHelpCount(Handle plugin, int numParams)
{
int len;
GetNativeStringLength(1, len);
if(len <= 0)
return false;
char[] map = new char[len+1];
GetNativeString(1, map, len+1);
int count = 0;
if (g_Config && g_Config.JumpToKey(map))
{
count = g_Config.GetNum("LowPopHelpCount", count);
g_Config.Rewind();
}
return count;
}
public int Native_GetMapCooldownTime(Handle plugin, int numParams)
{
int len;