Change team when die
#3

Hey there, here is a good idea for doing what you are trying to:

At the top of the file
Код:
#define TEAM_RED 0xFF0000AA
#define TEAM_BLUE 0x375FFFFF

new gTeam[MAX_PLAYERS];
Inside the middle
Код:
OnPlayerDeath(playerid, killerid, reason)
{
   if(gTeam[playerid] == TEAM_RED)
   {
       gTeam[playerid] = TEAM_BLUE;
       SetPlayerColor(playerid, TEAM_BLUE);
       GameTextForPlayer(playerid, "~w~You have been switched to team~n~~b~Blue",2500,6);
   }
   else if(gTeam[playerid] == TEAM_BLUE)
   {
       gTeam[playerid] = TEAM_RED;
       SetPlayerColor(playerid, TEAM_RED);
       GameTextForPlayer(playerid, "~w~You have been switched to team~n~~r~Red",2500,6);
   }
}
When a player dies, this will tell a player that they have been switched to whatever team opposite from their current team, and set their name color to the team color. Pretty basic system, but its what you wanted! Good Luck!
Reply


Messages In This Thread
Change team when die - by matdav - 24.07.2009, 23:16
Re: Change team when die - by matdav - 24.07.2009, 23:43
Re: Change team when die - by Luciano - 25.07.2009, 00:36
Re: Change team when die - by matdav - 25.07.2009, 02:25
Re: Change team when die - by matdav - 25.07.2009, 02:45

Forum Jump:


Users browsing this thread: 1 Guest(s)