[Problem] "initialization data exceeds declared size"
#1

Hello,

I am a coder in the French section.
If I come to post my problem here, it is because in the French section person was not able to help me.

I hope I can move forward as quickly as possible because the problem prevents me any continuation.

pawn Код:
#define NB_TEAMS 5

enum InfoTeam
{
    teamname[20],
    NbPlayers = 0,
    Float:Spawn[4],
};

new TeamInfo[NB_TEAMS][InfoTeam] =
{
    {"LSPD", 0, {1.0, 2.0, 3.0, 4.0}},
    {"Vagos", 0, {0.0, 0.0, 0.0, 0.0}},
    {"Aztecas", 0, {0.0, 0.0, 0.0, 0.0}},
    {"Ballas", 0, {0.0, 0.0, 0.0, 0.0}},
    {"Groove", 0, {0.0, 0.0, 0.0, 0.0}}
};
Reply
#2

NB_TEAMS and InfoTeam
Reply
#3

Quote:
Originally Posted by cesar_******
Посмотреть сообщение
NB_TEAMS and InfoTeam
Sorry,

pawn Код:
#define NB_TEAMS 5

enum InfoTeam
{
    teamname[20],
    NbPlayers = 0,
    Float:Spawn[4],
};
Reply
#4

Enums don't work like that! You are overwriting first character of teamname with NbPlayers.

pawn Код:
enum InfoTeam
{
    teamname[20],
    NbPlayers,
    Float:Spawn[4]
};
@down: don't forget about unnecessary comma after last element
Reply
#5

pawn Код:
#define NB_TEAMS 5

enum InfoTeam
{
    teamname[20],
    NbPlayers,/// problem repaired
    Float:Spawn[4],
};

new TeamInfo[NB_TEAMS][InfoTeam] =
{
    {"LSPD", 0, {1.0, 2.0, 3.0, 4.0}},
    {"Vagos", 0, {0.0, 0.0, 0.0, 0.0}},
    {"Aztecas", 0, {0.0, 0.0, 0.0, 0.0}},
    {"Ballas", 0, {0.0, 0.0, 0.0, 0.0}},
    {"Groove", 0, {0.0, 0.0, 0.0, 0.0}}
};
Reply
#6

pawn Код:
enum InfoTeam
{
    teamname[20],
    NbPlayers,
    Float:Spawn[4],
};

new TeamInfo[teamname/NbPlayers/Spawn][InfoTeam] =
{
    {"LSPD", 0, {1.0, 2.0, 3.0, 4.0}},
    {"Vagos", 0, {0.0, 0.0, 0.0, 0.0}},
    {"Aztecas", 0, {0.0, 0.0, 0.0, 0.0}},
    {"Ballas", 0, {0.0, 0.0, 0.0, 0.0}},
    {"Groove", 0, {0.0, 0.0, 0.0, 0.0}}
};
Try. ( You need to choose one of the following "teamname" or "NbPlayers" or "Spawn" wherever it is written "teamname/NbPlayers/Spawn" )
Reply
#7

Very Thanx !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)