Expose FindMap/ResolveFuzzyMapName to plugins.

This commit is contained in:
Nicholas Hastings
2015-06-27 13:10:47 -04:00
parent 25a8209ffc
commit f107ff9cd2
5 changed files with 126 additions and 28 deletions
+31
View File
@@ -0,0 +1,31 @@
#include <sourcemod>
public void OnPluginStart()
{
RegServerCmd("test_findmap", test_findmap);
}
public Action test_findmap( int argc )
{
char mapName[PLATFORM_MAX_PATH];
GetCmdArg(1, mapName, sizeof(mapName));
char resultName[16];
switch (FindMap(mapName, sizeof(mapName)))
{
case FindMap_Found:
strcopy(resultName, sizeof(resultName), "Found");
case FindMap_NotFound:
strcopy(resultName, sizeof(resultName), "NotFound");
case FindMap_FuzzyMatch:
strcopy(resultName, sizeof(resultName), "FuzzyMatch");
case FindMap_NonCanonical:
strcopy(resultName, sizeof(resultName), "NonCanonical");
case FindMap_PossiblyAvailable:
strcopy(resultName, sizeof(resultName), "PossiblyAvailable");
}
PrintToServer("FindMap says %s - \"%s\"", resultName, mapName);
return Plugin_Handled;
}