Teams - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Teams (
/showthread.php?tid=88686)
Teams -
Puzi - 28.07.2009
Код:
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
Re: Teams -
Puzi - 28.07.2009
please help!
I need to know how
Re: Teams -
DarkClone - 28.07.2009
Do you have #define TEAM_MAFIA at the top? and #define TEAM_BEACH (I suck at teams)
Re: Teams -
Puzi - 28.07.2009
Quote:
Originally Posted by Davis_JohnsonXD
Do you have #define TEAM_MAFIA at the top? and #define TEAM_BEACH (I suck at teams)
|
Yes.
Re: Teams -
Gappy - 28.07.2009
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);
Re: Teams -
Puzi - 28.07.2009
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
Re: Teams -
Gappy - 28.07.2009
you can't have 2 else's like that, change one to else if(classid == whatever)