View Single Post
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 05-25-2016 , 13:50   Re: Get amount of rows in enum
Reply With Quote #2

Assuming that the enum is sequential you can do this, otherwise i don't think there is.

Code:
#include <sourcemod>

enum EnumRows
{
	VAR1=0,
	VAR2,
	VAR3,
	VAR4,
	COUNT
};

public void OnPluginStart()
{
	int rows = view_as<int>(COUNT - VAR1);
	PrintToServer("%d", rows);
}
__________________
Chaosxk is offline