Quote:
Originally Posted by pds2012
here you go. just fill in the color that you want on /*Put your color define here*/ i prefer to use enum than arrays so just convert all of your teams that uses that array to the enum that i gave you.
here you go
Compiling
pawn Код:
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Code
pawn Код:
enum { TEAM_GROVE_STREET, TEAM_VAGOS, TEAM_BALLAS, TEAM_ITALIAN_MAFIA, TEAM_LSPD, TEAM_NATIONAL_GUARD } new pTeam[ MAX_PLAYERS ][ TEAM ];
stock SetPlayerToTeamColour(playerid) { if(pTeam[ playerid ][ TEAM_GROVE_STREET ]) return SetPlaColor(playerid, /*your color define here*/); if(pTeam[ playerid ][ TEAM_VAGOS ]) return SetPlaColor(playerid, /*your color define here*/); if(pTeam[ playerid ][ TEAM_BALLAS ]) return SetPlaColor(playerid, /*your color define here*/); if(pTeam[ playerid ][ TEAM_ITALIAN_MAFIA ]) return SetPlaColor(playerid, /*your color define here*/); if(pTeam[ playerid ][ TEAM_LSPD ]) return SetPlaColor(playerid, /*your color define here*/); if(pTeam[ playerid ][ TEAM_NATIONAL_GUARD ]) return SetPlaColor(playerid, /*your color define here*/); return 1; }
|
Alright well, this code is highly ignorant as you are using MULTIPLE variables to store the team.
There are 6 teams, so use one variable, such as "gTeam" or "Team" and set it to 1,2,3,4,5,6 depending on the class setup, and then on onplayerspawn, if the gTeam is 1, it's that team's color. simple.