If your array holds handles, you
should declare it as "new Handle:g_hCvarsList[CvarsList]" instead of leaving it untagged or forcing the tag in the function. Tagging your enum values as handles shouldn't accomplish anything.
The following three files compile fine exactly as so:
test.sp
PHP Code:
#include <sourcemod>
#include "file1"
#include "file2"
public OnPluginStart()
{
ConfigGetFilePath(CVAR_CONFIG_PATH_1, "");
}
file1.inc
PHP Code:
/**
* List of cvars used by the plugin.
*/
enum CvarsList
{
CVAR_CONFIG_PATH_1,
CVAR_CONFIG_PATH_2,
CVAR_CONFIG_PATH_3,
CVAR_CONFIG_PATH_4,
CVAR_CONFIG_PATH_5,
CVAR_CONFIG_PATH_6,
// Many more handles, but again, irrelevant.
}
/**
* Array to store cvar data in.
*/
new Handle:g_hCvarsList[CvarsList];
file2.inc
PHP Code:
/**
* Load config file.
*
* @param file The cvar define of the path to the file.
* @return True if the file exists, false if not.
*/
bool:ConfigGetFilePath(CvarsList:cvar, String:path[])
{
// Get cvar's path.
decl String:filepath[PLATFORM_MAX_PATH];
GetConVarString(g_hCvarsList[cvar], filepath, sizeof(filepath));
// Build full path in return string.
BuildPath(Path_SM, path, PLATFORM_MAX_PATH, filepath);
return FileExists(path);
}
If the Handle tag is removed from the array declaration, a tag mismatch warning will be emitted.