SA-MP Forums Archive
error 033: array must be indexed (variable "gTeam") - 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 033: array must be indexed (variable "gTeam") (/showthread.php?tid=349126)



error 033: array must be indexed (variable "gTeam") - sanrock - 07.06.2012

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?


Re: error 033: array must be indexed (variable "gTeam") - Littlehelper - 07.06.2012

That should be gTeam[playerid].


Re: error 033: array must be indexed (variable "gTeam") - sanrock - 07.06.2012

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)



Re: error 033: array must be indexed (variable "gTeam") - Littlehelper - 07.06.2012

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]));



Re: error 033: array must be indexed (variable "gTeam") - sanrock - 07.06.2012

The gTeam is for the team color when area captured.


Re: error 033: array must be indexed (variable "gTeam") - Littlehelper - 07.06.2012

EDIT:nvm.


Re: error 033: array must be indexed (variable "gTeam") - JhnzRep - 07.06.2012

Can you show us, how you define gTeam?


Re: error 033: array must be indexed (variable "gTeam") - HuSs3n - 07.06.2012

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


Re: error 033: array must be indexed (variable "gTeam") - sanrock - 07.06.2012

Cheers