View Single Post
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-24-2020 , 14:46   Re: Enum Structs Available This Holiday Season
Reply With Quote #39

The compiler doesn't appear to currently understand it as a type when parsing the function declaration, interestingly using it as any[] appears to work correctly but I have no idea if that is intended.

As with other array-like things in SourcePawn, it's almost certainly better to pass it as a param to be filled in by the callee.

PHP Code:
enum struct STest
{
    
int a;
    
int b;
}

STest test;

any[] GetTest()
{
   return 
test;
}

public 
void OnPluginStart()
{
    
test.4;
    
test.8;
    
    
STest other;
    
other GetTest();
    
    
PrintToServer("%d = %d, %d = %d"test.aother.atest.bother.b);

__________________

Last edited by asherkin; 06-24-2020 at 14:47.
asherkin is offline