#1

Код:
public SetPlayerTeamFromClass(playerid, classid)
{
	if (classid == 0)
	{
		gTeam[playerid] = TEAM_MAFIA;
	}
	else
	{
		gTeam[playerid] = TEAM_BEACH;
	}
}

public SetPlayerToTeamColor(playerid)
{
	if (gTeam[playerid] == TEAM_MAFIA)
	{
		SetPlayerColor(playerid, TEAM_MAFIA_COLOR);
	}
	else if (gTeam[playerid] == TEAM_BEACH)
	{
		SetPlayerColor(playerid, TEAM_BEACH_COLOR);
	}
}
i have more teams than it is here, but how can i add more? :S When i do:

Код:
	else
	{
		gTeam[playerid] = TEAM_BEACH;
	}
i just get errors and warnings

can someone help please?
Thanks and regards
Puzi
Reply
#2

please help! I need to know how
Reply
#3

Do you have #define TEAM_MAFIA at the top? and #define TEAM_BEACH (I suck at teams)
Reply
#4

Quote:
Originally Posted by Davis_JohnsonXD
Do you have #define TEAM_MAFIA at the top? and #define TEAM_BEACH (I suck at teams)
Yes.
Reply
#5

I'm not quite sure why that isn't working

Do you have like
#define TEAM 1
#define TEAM 2
#define TEAM 3 etc etc

and I'm not sure what this is used for but it might help

under OnGameModeInIt put SetTeamCount(amountofteams);
Reply
#6

Quote:
Originally Posted by Gappy
I'm not quite sure why that isn't working

Do you have like
#define TEAM 1
#define TEAM 2
#define TEAM 3 etc etc

and I'm not sure what this is used for but it might help

under OnGameModeInIt put SetTeamCount(amountofteams);
i did this:

Код:
public SetPlayerTeamFromClass(playerid, classid)
{
	if (classid == 0)
	{
		gTeam[playerid] = TEAM_MAFIA;
	}
	else
	{
		gTeam[playerid] = TEAM_BEACH;
	}
	else
	{
		gTeam[playerid] = TEAM_COPS;
 }
}
and I added the SetTeamCount one, and I still get this :S

Код:
C:\DOCUME~1\KAMIL\Pulpit\UNITED~1\GAMEMO~1\u-tdm.pwn(255) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
It seems that it is the line with the word ''else'' between TEAM_BEACH and TEAM_COPS :S
Reply
#7

you can't have 2 else's like that, change one to else if(classid == whatever)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)