From 26a23ae643bc5b6d7b71ea5decf77ab892ddde30 Mon Sep 17 00:00:00 2001 From: hubdom <26039831+hubdom@users.noreply.github.com> Date: Thu, 9 Jul 2020 23:23:40 +0200 Subject: [PATCH] MCE: add native to simulate MapEnd (for Cooldowns) --- .../scripting/include/mapchooser_extended.inc | 2 ++ mapchooser_extended/scripting/mapchooser_extended.sp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/mapchooser_extended/scripting/include/mapchooser_extended.inc b/mapchooser_extended/scripting/include/mapchooser_extended.inc index 4f7a45b4..4b8c052a 100644 --- a/mapchooser_extended/scripting/include/mapchooser_extended.inc +++ b/mapchooser_extended/scripting/include/mapchooser_extended.inc @@ -146,6 +146,8 @@ native int GetExtendsLeft(); native bool AreRestrictionsActive(); +native int SimulateMapEnd(); + public SharedPlugin __pl_mapchooser_extended = { name = "mapchooser", diff --git a/mapchooser_extended/scripting/mapchooser_extended.sp b/mapchooser_extended/scripting/mapchooser_extended.sp index 92d9ab0b..f5491d1f 100644 --- a/mapchooser_extended/scripting/mapchooser_extended.sp +++ b/mapchooser_extended/scripting/mapchooser_extended.sp @@ -424,6 +424,7 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max CreateNative("GetMapVIPRestriction", Native_GetMapVIPRestriction); CreateNative("GetExtendsLeft", Native_GetExtendsLeft); CreateNative("AreRestrictionsActive", Native_AreRestrictionsActive); + CreateNative("SimulateMapEnd", Native_SimulateMapEnd); return APLRes_Success; } @@ -2352,6 +2353,11 @@ public int Native_AreRestrictionsActive(Handle plugin, int numParams) return InternalAreRestrictionsActive(); } +public int Native_SimulateMapEnd(Handle plugin, int numParams) +{ + OnMapEnd(); +} + stock void AddMapItem(const char[] map) { AddMenuItem(g_VoteMenu, map, map);