View Single Post
Effeff
AlliedModders Donor
Join Date: Jan 2019
Location: discord: ff#0533
Old 03-04-2021 , 03:29   Re: Cannot declare enum structs that mix primitive members and array members
Reply With Quote #2

Example of how you can initialize the enum struct without the warning (compiles but untested).

PHP Code:
enum struct Survivor1
{
    
char name[MAX_NAME_LENGTH];
    
char model[PLATFORM_MAX_PATH];
    
int prop;
    
char adminflags[16];
    
void Create(char name[MAX_NAME_LENGTH], char model[PLATFORM_MAX_PATH], int propchar adminflags[16])
    {
        
strcopy(this.nameMAX_NAME_LENGTHname);
        
strcopy(this.modelPLATFORM_MAX_PATHmodel);
        
this.prop prop;
        
strcopy(this.adminflags16adminflags);
    }
}

public 
void OnPluginStart()  
{
    
Survivor1 e;
    
e.Create("Ellis""models/survivors/survivor_mechanic.mdl"3"bcd");
    
    
PrintToServer("%s %s %i %s"e.namee.modele.prope.adminflags);


Last edited by Effeff; 03-04-2021 at 03:31.
Effeff is offline