how do i do this?
#1

how do I make the Following team being Anti teamkill by the humans?

Is it like this?:
pawn Код:
if(gTeam[playerid] == TEAM_BLOODLINE)
{
    new string[64], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    format(string, sizeof(string), "BLOODLINE ANNOUNCE: %s is now on-duty.", name);
    SendClientMessageToAll(0xD40412FF, string);
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100);
    SetPlayerSkin(playerid, blskins[random(3)]);
    SetPlayerTeam(playerid, 2); // This onee
        SetPlayerTeam(playerid, 1); // and this one
}
Reply
#2

By using SetPlayerTeam, I think it works as an anti-teamkill too. Or else, you could try something like this:
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.
   }
  return 1;
}
//I believe this could work.
Reply
#3

Is that only for 1 team?
I want to make it 2 team anti-team kills?

BTW Thanks. REp 1

PLS help

Im not a very good scripter
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)