redoing with new native to not screw up the nominations related native

This commit is contained in:
jenz 2026-04-14 22:46:24 +02:00
parent 8e33a8bd87
commit 7d5e56540a
2 changed files with 21 additions and 3 deletions

View File

@ -111,6 +111,7 @@ native bool ExcludeMapTime(const char[] map, int cooldown = 0, int mode = 0);
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 GetMapMinTime(const char[] map);
native int GetMapMaxTime(const char[] map);
native int GetMapMinPlayers(const char[] map);

View File

@ -480,6 +480,7 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
CreateNative("ExcludeMapTime", Native_ExcludeMapTime);
CreateNative("GetMapCooldown", Native_GetMapCooldown);
CreateNative("GetMapCooldownTime", Native_GetMapCooldownTime);
CreateNative("GetMapCooldownTime2", Native_GetMapCooldownTime2);
CreateNative("GetMapMinTime", Native_GetMapMinTime);
CreateNative("GetMapMaxTime", Native_GetMapMaxTime);
CreateNative("GetMapMinPlayers", Native_GetMapMinPlayers);
@ -2779,8 +2780,8 @@ public int Native_GetMapCooldown(Handle plugin, int numParams)
return Cooldown;
}
//GetMapCooldownTime
public int Native_GetMapCooldownTime(Handle plugin, int numParams)
//GetMapCooldownTime2
public int Native_GetMapCooldownTime2(Handle plugin, int numParams)
{
int len;
GetNativeStringLength(1, len);
@ -2794,6 +2795,23 @@ public int Native_GetMapCooldownTime(Handle plugin, int numParams)
return InternalGetMapCooldownTime2(map);
}
public int Native_GetMapCooldownTime(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 Cooldown = 0;
g_TimeMapList.GetValue(map, Cooldown);
return Cooldown;
}
public int Native_GetMapMinTime(Handle plugin, int numParams)
{
int len;
@ -3122,7 +3140,6 @@ stock int InternalGetMapCooldownTime(const char[] map)
g_Config.Rewind();
}
return Cooldown;
}