error 033: array must be indexed (variable "gTeam")
#1

pawn Код:
for(new i=0; i < sizeof(ZoneInfo); i++)
    {
    GangZoneShowForPlayer(playerid, ZoneID[i], GetTeamZoneColor(ZoneInfo[i][gTeam]));
    }
Error:
Код:
C:\Users\Jo\Downloads\MySQL.pwn(412) : error 033: array must be indexed (variable "gTeam")
Line:
pawn Код:
GangZoneShowForPlayer(playerid, ZoneID[i], GetTeamZoneColor(ZoneInfo[i][gTeam]));
I done the gTeam[MAX_PLAYERS]; lbblb stuff

What happened?
Reply
#2

That should be gTeam[playerid].
Reply
#3

but if I make it
pawn Код:
GangZoneShowForAll(ZoneID[i], GetTeamZoneColor(ZoneInfo[i], gTeam[playerid])); // update the zone color for new team
it shows this error
Код:
C:\Users\Jo\Downloads\MySQL.pwn(325) : error 035: argument type mismatch (argument 1)
Reply
#4

Actually there is no need to define Team variable when you are showing the gang zone to everyone.
pawn Код:
GangZoneShowForAll(ZoneID[i], GetTeamZoneColor(ZoneInfo[i]));
Reply
#5

The gTeam is for the team color when area captured.
Reply
#6

EDIT:nvm.
Reply
#7

Can you show us, how you define gTeam?
Reply
#8

you have
pawn Код:
gTeam[MAX_PLAYERS];
and
pawn Код:
ZoneInfo[i][gTeam]
you cant have both with same name ("gTeam")

remove gTeam[MAX_PLAYERS] OR rename it to gTeam2[MAX_PLAYERS] or whatever
Reply
#9

Cheers
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)