problem with enum
#1

Quote:

new teamScore[MAX_PLAYERS][pTeams];

enum pTeams
{
TEAM_POLICE,
TEAM_SWAT,
TEAM_ARMY,
TEAM_AMCSI,
TEAM_COLUMBIANO,
TEAM_KINA,
TEAM_TERRO
};

Quote:

Gang-Wars.pwn(80) : error 017: undefined symbol "pTeams"
Gang-Wars.pwn(80) : error 009: invalid array size (negative, zero or out of bounds)

2 errors
pls help
Reply
#2

Quote:
Originally Posted by LZLo
Посмотреть сообщение
2 errors
pls help
pawn Код:
enum pTeams
{
TEAM_POLICE,
TEAM_SWAT,
TEAM_ARMY,
TEAM_AMCSI,
TEAM_COLUMBIANO,
TEAM_KINA,
TEAM_TERRO
};
new teamScore[MAX_PLAYERS][pTeams];
The Pawn compiler reads down, therefore it hasn't created pTeams yet before you initialize the variable.
Reply
#3

You should put the enum before
Reply
#4

an other problem xD

Quote:

enum pTeams
{
TEAM_POLICE,
TEAM_SWAT,
TEAM_ARMY,
TEAM_AMCSI,
TEAM_COLUMBIANO,
TEAM_KINA,
TEAM_TERRO
};
new teamScore[MAX_PLAYERS][pTeams];

onplayerdeath
Quote:

for(new i=0, m=GetMaxPlayers(); i<m; i++)//for(new i=0, m=GetMaxPlayers(); i<m; i++)
{
if(gTeam[playerid] == TEAM_POLICE)
{
teamScore[i][TEAM_POLICE]++;
if(teamScore[i][TEAM_POLICE] >= 50)
{
GameTextForAll("~w~Corleones Won",5000,0);
SetTimer("EndGM", 10000,0);
}
}
if(gTeam[playerid] == TEAM_SWAT)
{
teamScore[i][TEAM_POLICE]++;
if(teamScore[i][TEAM_POLICE] >= 50)
{
GameTextForAll("~w~Corleones Won",5000,0);
SetTimer("EndGM", 10000,0);
}
}
if(gTeam[playerid] == TEAM_ARMY)
{
teamScore[i][TEAM_ARMY]++;
if(teamScore[i][TEAM_ARMY] >= 50)
{
GameTextForAll("~w~Corleones Won",5000,0);
SetTimer("EndGM", 10000,0);
}
}
if(gTeam[playerid] == TEAM_AMCSI)
{
teamScore[i][TEAM_AMCSI]++;
if(teamScore[i][TEAM_AMCSI] >= 50)
{
GameTextForAll("~w~Corleones Won",5000,0);
SetTimer("EndGM", 10000,0);
}
}
if(gTeam[playerid] == TEAM_COLUMBIANO)
{
teamScore[i][TEAM_COLUMBIANO]++;
if(teamScore[i][TEAM_COLUMBIANO] >= 50)
{
GameTextForAll("~w~Corleones Won",5000,0);
SetTimer("EndGM", 10000,0);
}
}
if(gTeam[playerid] == TEAM_TERRO)
{
teamScore[i][TEAM_TERRO]++;
if(teamScore[i][TEAM_TERRO] >= 50)
{
GameTextForAll("~w~Corleones Won",5000,0);
SetTimer("EndGM", 10000,0);
}
}
if(gTeam[playerid] == TEAM_KINA)
{
teamScore[i][TEAM_KINA]++;
if(teamScore[i][TEAM_KINA] >= 50)
{
GameTextForAll("~w~Corleones Won",5000,0);
SetTimer("EndGM", 10000,0);
}
}
}

errors:
Quote:

D:\LETONAK2\gamemodes\Gang-Wars.pwn(890) : warning 213: tag mismatch
D:\LETONAK2\gamemodes\Gang-Wars.pwn(891) : warning 213: tag mismatch
D:\LETONAK2\gamemodes\Gang-Wars.pwn(899) : warning 213: tag mismatch
D:\LETONAK2\gamemodes\Gang-Wars.pwn(900) : warning 213: tag mismatch
D:\LETONAK2\gamemodes\Gang-Wars.pwn(90 : warning 213: tag mismatch
D:\LETONAK2\gamemodes\Gang-Wars.pwn(909) : warning 213: tag mismatch
D:\LETONAK2\gamemodes\Gang-Wars.pwn(917) : warning 213: tag mismatch
D:\LETONAK2\gamemodes\Gang-Wars.pwn(91 : warning 213: tag mismatch
D:\LETONAK2\gamemodes\Gang-Wars.pwn(926) : warning 213: tag mismatch
D:\LETONAK2\gamemodes\Gang-Wars.pwn(927) : warning 213: tag mismatch
D:\LETONAK2\gamemodes\Gang-Wars.pwn(935) : warning 213: tag mismatch
D:\LETONAK2\gamemodes\Gang-Wars.pwn(935) : error 032: array index out of bounds (variable "teamScore")
D:\LETONAK2\gamemodes\Gang-Wars.pwn(936) : warning 213: tag mismatch
D:\LETONAK2\gamemodes\Gang-Wars.pwn(936) : error 032: array index out of bounds (variable "teamScore")
D:\LETONAK2\gamemodes\Gang-Wars.pwn(944) : warning 213: tag mismatch
D:\LETONAK2\gamemodes\Gang-Wars.pwn(945) : warning 213: tag mismatch

Reply
#5

solved!! thx all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)