15.09.2011, 20:03
Quote:
Uhh, Here..
pawn Код:
|
Correct:
pawn Код:
// Define your teams...
#define TEAM_ONE 0
#define TEAM_TWO 1
// TEAM_THREE would be 2, FOUR 3, etc.
// Making the variable where the player team will be stored ...
static gTeam[ MAX_PLAYERS ];
public OnGameModeInit( ) {
// AddPlayerClass code for team one.
// AddPlayerClass code for team two.
return 1;
}
public OnPlayerRequestClass( playerid, classid ) {
if( classid == TEAM_ONE ) {
// Set the player skin and color for team one.
gTeam[ playerid ] = TEAM_ONE;
}
if( classid == TEAM_TWO ) {
// Set the player skin and color for team two.
gTeam[ playerid ] = TEAM_TWO;
}
// You don't have to set the skin if you set it in AddPlayerClass.
return 1;
}
public OnPlayerSpawn( playerid ) {
if( gTeam[ playerid ] == TEAM_ONE ) {
// Give weapons, cash, health, whatever for team one.
}
if( gTeam[ playerid ] == TEAM_TWO ) {
// Give weapons, cash, health, whatever for team two.
}
return 1;
}