error 021: symbol already defined - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error 021: symbol already defined (
/showthread.php?tid=631122)
error 021: symbol already defined -
Johangelo1 - 23.03.2017
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");
}
Re: error 021: symbol already defined -
ISmokezU - 23.03.2017
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
Respuesta: error 021: symbol already defined -
Johangelo1 - 23.03.2017
thanks you