summaryrefslogtreecommitdiff
path: root/sourcemod/scripting/gokz-core/map/prefix.sp
diff options
context:
space:
mode:
authornavewindre <nw@moneybot.cc>2023-12-04 18:06:10 +0100
committernavewindre <nw@moneybot.cc>2023-12-04 18:06:10 +0100
commitaef0d1c1268ab7d4bc18996c9c6b4da16a40aadc (patch)
tree43e766b51704f4ab8b383583bdc1871eeeb9c698 /sourcemod/scripting/gokz-core/map/prefix.sp
parent38f1140c11724da05a23a10385061200b907cf6e (diff)
bbbbbbbbwaaaaaaaaaaa
Diffstat (limited to 'sourcemod/scripting/gokz-core/map/prefix.sp')
-rw-r--r--sourcemod/scripting/gokz-core/map/prefix.sp48
1 files changed, 48 insertions, 0 deletions
diff --git a/sourcemod/scripting/gokz-core/map/prefix.sp b/sourcemod/scripting/gokz-core/map/prefix.sp
new file mode 100644
index 0000000..3ecbf89
--- /dev/null
+++ b/sourcemod/scripting/gokz-core/map/prefix.sp
@@ -0,0 +1,48 @@
+/*
+ Mapping API - Prefix
+
+ Detects the map's prefix.
+*/
+
+
+
+static int currentMapPrefix;
+
+
+
+// =====[ PUBLIC ]=====
+
+int GetCurrentMapPrefix()
+{
+ return currentMapPrefix;
+}
+
+
+
+// =====[ LISTENERS ]=====
+
+void OnMapStart_Prefix()
+{
+ char map[PLATFORM_MAX_PATH], mapPrefix[PLATFORM_MAX_PATH];
+ GetCurrentMapDisplayName(map, sizeof(map));
+
+ // Get all characters before the first '_' character
+ for (int i = 0; i < sizeof(mapPrefix); i++)
+ {
+ if (map[i] == '\0' || map[i] == '_')
+ {
+ break;
+ }
+
+ mapPrefix[i] = map[i];
+ }
+
+ if (StrEqual(mapPrefix[0], "kzpro", false))
+ {
+ currentMapPrefix = MapPrefix_KZPro;
+ }
+ else
+ {
+ currentMapPrefix = MapPrefix_Other;
+ }
+} \ No newline at end of file