diff --git a/mapchooser_extended/scripting/include/mapchooser_extended.inc b/mapchooser_extended/scripting/include/mapchooser_extended.inc index d468336..691b9f2 100755 --- a/mapchooser_extended/scripting/include/mapchooser_extended.inc +++ b/mapchooser_extended/scripting/include/mapchooser_extended.inc @@ -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); diff --git a/mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp b/mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp index 9cfeed5..a687087 100755 --- a/mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp +++ b/mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp @@ -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; }