Skip to content

Examples

ambaca edited this page Oct 10, 2017 · 2 revisions
#include <insurgency_maps>

public void OnPluginStart()
{
	RegConsoleCmd("sm_test", test);
}

public Action test(int client, int args)
{
	int mapcount = InsurgencyMap_MapCount();
	ReplyToCommand(client, "We have %i maps inside insurgency_maps KeyValue structure", mapcount);

	return Plugin_Handled;
}

#include <insurgency_maps>


public void OnPluginStart()
{
	RegConsoleCmd("sm_test", test);
}

public Action test(int client, int args)
{
	ArrayList maps = CreateArray(ByteCountToCells(PLATFORM_MAX_PATH));
	InsurgencyMap_MapArray(maps);

	int count = GetArraySize(maps);
	char buffer[PLATFORM_MAX_PATH];

	for(int x = 0; x < count; x++)
	{
		GetArrayString(maps, x, buffer, sizeof(buffer));
		ReplyToCommand(client, "%i Map name %s", x, buffer);
	}

	delete maps;

	return Plugin_Handled;
}
Clone this wiki locally