SA-MP Forums Archive
UnExplained Error In gTeam [+REP] - 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: UnExplained Error In gTeam [+REP] (/showthread.php?tid=310196)



UnExplained Error In gTeam [+REP] - Dustly - 11.01.2012

My teams for USA are correctly defined
Quote:

#define TEAM_USA1 //U.S 1st division
#define TEAM_USA1_COLOR 0x0000FFFF

#define TEAM_USA2 //U.S 2nd division
#define TEAM_USA2_COLOR 0x0000FFFF

#define TEAM_USA3 //U.S 3rd division
#define TEAM_USA3_COLOR 0x0000FFFF

I have this
Quote:

new gTeam[MAX_PLAYERS];

However error is unexplained here.
Quote:

SetPlayerTeamFromClass(playerid, classid)
{
if (classid == 0)
{
gTeam[playerid] = TEAM_USA1;//error here line 107
SetPlayerTeam(playerid, 1);
}
else if (classid == 1)
{
gTeam[playerid] = TEAM_USA2; //error here line 112
SetPlayerTeam(playerid, 1);
}
else if (classid == 2)
{
gTeam[playerid] = TEAM_USA3; //error here line 117
SetPlayerTeam(playerid, 1);
}
}

error message appears like this.
Quote:

(107) : error 029: invalid expression, assumed zero
(112) : error 029: invalid expression, assumed zero
(117) : error 029: invalid expression, assumed zero

These three teams are allies, I set USA to 3 different teams for purposes I dont care to explain. Can some one please explain where I went wrong?


Re: UnExplained Error In gTeam [+REP] - FarSe. - 11.01.2012

#define TEAM_USA1 1//U.S 1st division
#define TEAM_USA1_COLOR 0x0000FFFF

#define TEAM_USA2 2//U.S 2nd division
#define TEAM_USA2_COLOR 0x0000FFFF

#define TEAM_USA3 3//U.S 3rd division
#define TEAM_USA3_COLOR 0x0000FFFF


Re: UnExplained Error In gTeam [+REP] - Dustly - 11.01.2012

Nvm I firgured that second bit myself. Thanks for pointing out my retarded mistake.
I havent workd with gteam for awhile. Heres ur rep.