PHP Code:
// Translates a class index to a TFClassType enum value (1 ----> TFClass_Scout)
// Since the current TFClassType enum doesn't map 1-to-1 with the order of the classes on the class menu,
// this native attempts to correct for this problem.
//
// Prototype: TFClassType ClassIndexToTFClass(int iClient, int ClassIndex)
public int Native_ClassIndexToTFClass(Handle plugin, int nParams)
{
// Get the client index and the class index:
int iClient = GetNativeCell(1);
int ClassIndex = GetNativeCell(2);
// Then determine the appropriate return value:
switch (ClassIndex)
{
case -1: return TFClass_Unknown; // All 9 classes.
case 0: return TF2_GetPlayerClass(iClient); // The client's current class.
case 1: return TFClass_Scout;
case 2: return TFClass_Soldier;
case 3: return TFClass_Pyro;
case 4: return TFClass_DemoMan;
case 5: return TFClass_Heavy;
case 6: return TFClass_Engineer;
case 7: return TFClass_Medic;
case 8: return TFClass_Sniper;
case 9: return TFClass_Spy;
}
return TF2_GetPlayerClass(iClient); // Fail-safe method.
}
Code:
E:\Servers\Management Tools\Sourcemod Plugins\Done\mvm_itemsinfo.sp(1852) : warning 213: tag mismatch
E:\Servers\Management Tools\Sourcemod Plugins\Done\mvm_itemsinfo.sp(1853) : warning 213: tag mismatch
E:\Servers\Management Tools\Sourcemod Plugins\Done\mvm_itemsinfo.sp(1854) : warning 213: tag mismatch
E:\Servers\Management Tools\Sourcemod Plugins\Done\mvm_itemsinfo.sp(1855) : warning 213: tag mismatch
E:\Servers\Management Tools\Sourcemod Plugins\Done\mvm_itemsinfo.sp(1856) : warning 213: tag mismatch
E:\Servers\Management Tools\Sourcemod Plugins\Done\mvm_itemsinfo.sp(1857) : warning 213: tag mismatch
E:\Servers\Management Tools\Sourcemod Plugins\Done\mvm_itemsinfo.sp(1858) : warning 213: tag mismatch
E:\Servers\Management Tools\Sourcemod Plugins\Done\mvm_itemsinfo.sp(1859) : warning 213: tag mismatch
E:\Servers\Management Tools\Sourcemod Plugins\Done\mvm_itemsinfo.sp(1860) : warning 213: tag mismatch
E:\Servers\Management Tools\Sourcemod Plugins\Done\mvm_itemsinfo.sp(1861) : warning 213: tag mismatch
E:\Servers\Management Tools\Sourcemod Plugins\Done\mvm_itemsinfo.sp(1862) : warning 213: tag mismatch
Line #1852 is the "case -1:" section, and it complains at all the TFClassType values that are returned. Moreover, if I put view_as<int>() around them all, it works fine. I can't change the "int" from the function prototype since it's a native function call and they have to be tagged as an int. Any suggestions?