11.08.2012, 18:38
is it possible to create another 'gTeam' ?? If so, how can i do it (create the team and define the 'subteams')
is it possible to create another 'gTeam' ?? If so, how can i do it (create the team and define the 'subteams')
|
#define TEAM_ONE (1)
#define TEAM_TWO (2)
#define TEAM_THREE (3)
// and so on
SetPlayerTeam( playerid, TEAM_ONE ); // you can use TEAM_ONE, TEAM_TWO or TEAM_THREE as the team id
// now for getting the team name you can do somethign like this:
stock GetTeamName( teamid )
{
new szStr[ 24 ];
switch( teamid )
{
case TEAM_ONE:
{
format( szStr, sizeof( szStr ), "Team Name ONE" ); // change the name
}
case TEAM_TWO:
{
format( szStr, sizeof( szStr ), "Team Name TWO" ); // change the name
}
case TEAM_THREE:
{
format( szStr, sizeof( szStr ), "Team Name THREE" ); // change the name
}
// and so on
}
return szStr;
}
CMD:myteam( playerid, params[ ] ) // example of GetTeamName function
{
new sz_bStr[ 30 ];
format( sz_bStr, sizeof( sz_bStr ), "My team is: %s", GetTeamName( GetPlayerTeam( playerid ) ) );
SendClientMessage( playerid, -1, sz_bStr );
return 1;
}