error 021: symbol already defined
#1

How could you solve this error?


Код:
 error 021: symbol already defined: "EventInfo"
PHP код:
enum EventInfo
{
Float:Xq,        Float:Yq,        Float:Zq,        Float:Aq,
Nome[64],        Aberto,        Criado,            Cerrado,
Premio1,        Premio2,        Premio3,        PremioS,
Cor1,            Cor2,            Arma,            Admin[64],        
Vida,
};
new 
EventInfo[MAX_PLAYERS]; 
PHP код:
//Line where it gives the error
 
if(EventInfo[Criado] == 0)//error 
    
{ 
        
ShowPlayerDialog(playerid, DIALOG_EVENTO, DIALOG_STYLE_LIST, "Own Event: Closed", Mensagem, "Selecc", "Cancel"); 
    } 
    else if(
EventInfo[Criado] == 1) //error 
    
{ 
        new 
StrE[1000]; 
        
format(StrE,sizeof(StrE),"Own Event: Opened by %s",EventInfo[Admin]);
        
ShowPlayerDialog(playerid, DIALOG_EVENTO, DIALOG_STYLE_LIST, StrE, Mensagem, "Selecc", "Cancel"); 
    } 
Reply
#2

Don't do it like that.

PHP код:
enum EventInfo 
{ 
Float:Xq,        Float:Yq,        Float:Zq,        Float:Aq, 
Nome[64],        Aberto,        Criado,            Cerrado, 
Premio1,        Premio2,        Premio3,        PremioS, 
Cor1,            Cor2,            Arma,            Admin,  // Admin[64] Why 64?     
Vida, 
}; 
new 
Player[MAX_PLAYERS][EventInfo];
if(
Player[playerid][Criado] == 0)  
    {  
        
ShowPlayerDialog(playerid, DIALOG_EVENTO, DIALOG_STYLE_LIST, "Own Event: Closed", Mensagem, "Selecc", "Cancel");  
    }  
    else if(
Player[playerid][Criado] == 1)   
    {  
        new 
StrE[ 75 ];  
        
format(StrE,sizeof(StrE),"Own Event: Opened by %s",Player[playerid][Admin]); //Still think we need a GetName Function here
        
ShowPlayerDialog(playerid, DIALOG_EVENTO, DIALOG_STYLE_LIST, StrE, Mensagem, "Selecc", "Cancel");  
    } 
Read up more on Enums here
Reply
#3

thanks you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)