how do i do this?
#4

Here's it
pawn Код:
new team1[MAX_PLAYERS], team2[MAX_PLAYERS]; //Creating two team global variables.

public OnPlayerTakeDamage(playerid, issueried, Float:amount, weaponid)
{
  if(Team1[issuerid] == 1 && Team1[playerid] == 1)  //If issuer and the player is in same team.
  {
    new Float:hp[MAX_PLAYERS];
    GetPlayerHealth(playerid, hp[playerid]);
    SetPlayerHealth(playerid, hp[playerid]); //So, here it gives balance and the player won't die.
   }
  else if(Team2[issuerid] == 1 && Team2[playerid] == 1)  //If issuer and the player is in same team.
  {
    new Float:hp[MAX_PLAYERS];
    GetPlayerHealth(playerid, hp[playerid]);
    SetPlayerHealth(playerid, hp[playerid]); //So, here it gives balance and the player won't die.
   }
  return 1;
}

public OnPlayerUpdate(playerid)
{
 if(Team1[playerid] == 1) return Team2[playerid] = 0;
 if(Team2[playerid] == 1) return Team1[playerid] = 1;
 return 1;
}

/*You can setplayer's team in this case like this:

Team1[playerid] = 1; //Then player is in team1.
Team2[playerid] = 1; //Then player is in team2.
*/
Reply


Messages In This Thread
how do i do this? - by Deaglez - 10.11.2012, 02:14
Re: how do i do this? - by Lordzy - 10.11.2012, 02:35
Re: how do i do this? - by Deaglez - 10.11.2012, 02:56
Re: how do i do this? - by Lordzy - 10.11.2012, 06:34

Forum Jump:


Users browsing this thread: 6 Guest(s)