problem with code
#1

I've got some problems and don't know how to fix them, i looked everywhere but didin't find anything value...
Код:
D:\SA-MP GameModes\GangWars\gamemodes\Untitled.pwn(62) : error 001: expected token: "-identifier-", but found "("
D:\SA-MP GameModes\GangWars\gamemodes\Untitled.pwn(64) : error 010: invalid function or declaration
D:\SA-MP GameModes\GangWars\gamemodes\Untitled.pwn(66) : error 010: invalid function or declaration
D:\SA-MP GameModes\GangWars\gamemodes\Untitled.pwn(67) : error 010: invalid function or declaration
D:\SA-MP GameModes\GangWars\gamemodes\Untitled.pwn(68) : error 010: invalid function or declaration
D:\SA-MP GameModes\GangWars\gamemodes\Untitled.pwn(70) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Lines:
Код:
stock GetTeamZoneColor(teamid) // line 62
{
	switch(teamid) // line 64
	{
		case TEAM_GROVE: return 0x00FF0088; //line 66
		case TEAM_BALLAS: return 0xFF00FF88; //line 67
		case TEAM_VAGOS: return 0xFFFF0088; //line 68
	}
	return -1;  //line 70
}
What i'm doing wrong?
Reply
#2

Maybe you forget a closing bracket in the code above this function?
Reply
#3

GetTeamZoneColor never used before?
Reply
#4

Quote:
Originally Posted by Raidensama
Посмотреть сообщение
GetTeamZoneColor never used before?
He used stock, which means that if you don't use the function, it wont compile or give warnings/errors.
Reply
#5

any errors before? where is GetTeamZoneColor used?
function compiles clearly for me
Reply
#6

Nothing wrong with the function (though you might want to use a constant array instead). Show a few lines above that part. Might be an extra brace or bracket or something like that.
Reply
#7

here more lines:
Код:
public OnPlayerSpawn(playerid)
for(new i=0; i < sizeof(ZoneInfo); i++)
{
	GangZoneShowForPlayer(playerid, ZoneID[i], GetTeamZoneColor(ZoneInfo[i][zTeam]));
}

stock GetTeamZoneColor(teamid)
{
	switch[100](teamid)
	{
		case TEAM_GROVE: return 0x00FF0088;
		case TEAM_BALLAS: return 0xFF00FF88;
		case TEAM_VAGOS: return 0xFFFF0088;
	}
	return -1;
}
Reply
#8

Code in functions should be put in compund blocks:
pawn Код:
public OnPlayerSpawn(playerid)
{
    for(new i=0; i < sizeof(ZoneInfo); i++)
    {
        GangZoneShowForPlayer(playerid, ZoneID[i], GetTeamZoneColor(ZoneInfo[i][zTeam]));
    }
    return 1;
}
Reply
#9

same problems still remains...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)