19.02.2010, 01:51
Код:
SetPlayerTeamFromClass(playerid, classid) { if (classid == 105) { gTeam[playerid] = TeamGrovest;
Код:
SetPlayerTeamFromClass(playerid, classid) { if (classid == 105,106,107) { gTeam[playerid] = TeamGrovest;
SetPlayerTeamFromClass(playerid, classid) { if (classid == 105) { gTeam[playerid] = TeamGrovest;
SetPlayerTeamFromClass(playerid, classid) { if (classid == 105,106,107) { gTeam[playerid] = TeamGrovest;
if(classid == 105 || classid == 106 || classid == 107)
SetPlayerTeamFromClass(playerid, classid)
{
switch(classid)
{
case 105, 106, 107:
{
// code
}
case 108:
{
// code for if(classid == 108)
}
case 109 .. 120: // this mean from 109 to 120 (if (classid == 109 || classif == 110...)
{
// code
}
default: // this is "else"
{
// code
}
}
return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
switch(classid)
{
case 105 .. 107: gTeam[playerid] = TeamGrovest;
}
return 1;
}
#define TeamGrovest 1 #define TeamBallas 2 #define TeamVagos 3 #define TeamTriads 4 #define TeamGrovestColor 0x339900AA #define TeamBallasColor 0xAF00FFAA #define TeamVagosColor 0xBF00FFAA #define TeamTriadsColor 0xCF00FFAA //these are just random colors for testing. I'll change them later.
SetPlayerTeamFromClass(playerid, classid) { { if(classid == 105 || classid == 106 || classid == 107) gTeam[playerid] = TeamGrovest; } { if(classid == 102 || classid == 103 || classid == 104) gTeam[playerid] = TeamBallas; } { if(classid == 108 || classid == 109 || classid == 110) gTeam[playerid] = TeamVagos; } { if(classid == 117 || classid == 118 || classid == 120) gTeam[playerid] = TeamTriads; } } SetPlayerToTeamColor(playerid) { if (gTeam[playerid] == TeamGrovest) { SetPlayerColor(playerid, TeamGrovestColor); } else if (gTeam[playerid] == TeamBallas) { SetPlayerColor(playerid, TeamBallasColor); } else if (gTeam[playerid] == TeamVagos) { SetPlayerColor(playerid, TeamVagosColor); } else if (gTeam[playerid] == TeamTriads) { SetPlayerColor(playerid, TeamTriadsColor); } }
#define TeamGrovestColor 0x339900AA #define TeamBallasColor 0xAF00FFAA #define TeamVagosColor 0xBF00FFAA #define TeamTriadsColor 0xCF00FFAA
#define TeamGrovestColor 0x33990099 #define TeamBallasColor 0xAF00FF99 #define TeamVagosColor 0xBF00FF99 #define TeamTriadsColor 0xCF00FF99
SetPlayerToTeamColor(playerid) { if (gTeam[playerid] == TeamGrovest) { SetPlayerColor(playerid, TeamGrovestColor); } else if (gTeam[playerid] == TeamBallas) { SetPlayerColor(playerid, TeamBallasColor); } else if (gTeam[playerid] == TeamVagos) { SetPlayerColor(playerid, TeamVagosColor); } else if (gTeam[playerid] == TeamTriads) { SetPlayerColor(playerid, TeamTriadsColor); } return 1; }