Add new function: GetMapDisplayName.
This function will resolve the name of a map using FindMap, then (if applicable), will turn a workshop map name into a nicely formatted name. Currently only TF2 and CS:GO Map Workshops are supported. More can be added at a later date. This function returns false if a map was not found, but true in any other instance even if FindMap could not resolve the map name. This patch also updates the following core plugins to use this GetMapDisplayName: BaseTriggers BaseVotes MapChooser NextMap Nominations RandomCycle RockTheVote
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#include <sourcemod>
|
||||
|
||||
public void OnPluginStart()
|
||||
{
|
||||
RegServerCmd("test_mapdisplayname", test_mapdisplayname);
|
||||
}
|
||||
|
||||
public Action test_mapdisplayname( int argc )
|
||||
{
|
||||
char mapName[PLATFORM_MAX_PATH];
|
||||
GetCmdArg(1, mapName, sizeof(mapName));
|
||||
|
||||
char displayName[PLATFORM_MAX_PATH];
|
||||
|
||||
if (GetMapDisplayName(mapName, displayName, sizeof(displayName)))
|
||||
{
|
||||
PrintToServer("GetMapDisplayName says \"%s\" for \"%s\"", displayName, mapName);
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintToServer("GetMapDisplayName says \"%s\" was not found or not resolved", mapName);
|
||||
}
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
Reference in New Issue
Block a user