How to make it...
#1

Hey.

I've created 4 teams on my server. There's 2 teams of cops, who are alliated, and 2 more teams called militars, who also are alliated.

#define TEAM_COP 0
#define TEAM_COP2 0

#define TEAM_MILITAR 1
#define TEAM_MILITAR2 1

They are defined by gTeam. My question is... how could I create an anti team killer? But only with him team, for example, TEAM_COP can't kill TEAM_COP2, but can kill TEAM_MILITAR and TEAM_MILITAR2.

Thanks
Reply
#2

You can use
Код:
SetPlayerTeam(playerid, team)
Example, like team cop and cop2
Код:
SetPlayerTeam(playerid, 1)
and the other team
Код:
SetPlayerTeam(playerid, 2)
Reply
#3

Quote:
Originally Posted by tjying95
You can use
Код:
SetPlayerTeam(playerid, team)
Example, like team cop and cop2
Код:
SetPlayerTeam(playerid, 1)
and the other team
Код:
SetPlayerTeam(playerid, 2)
You're totally wrong. He wants to know how to make an anti team kill thing.
Reply
#4

He's not wrong... you can paste that under OnPlayerDeath...
smth like:

Код:
if(GetPlayerTeam(playerid)==1)
{
if(GetPlayerTeam(killerid)==1)
{
//the thing that should happen in case of TK
}
}
Reply
#5

1. Your code fails.
2. He want to know how to make it like when a player attacks a player from his own team, the player that he attacked wouldn't lose any health.

EDIT: Your code still fails.
Reply
#6

I see :/
Reply
#7

pawn Код:
// OnPlayerSpawn
  if(gTeam[playerid] == 0)
  {
    SetPlayerTeam(playerid, 0);
  }
  else if (gTeam[playerid] == 1)
  {
    SetPlayerTeam(playerid, 1);
  }
Reply
#8

Quote:
Originally Posted by Abernethy
pawn Код:
// OnPlayerSpawn
  if(gTeam[playerid] == 0)
  {
    SetPlayerTeam(playerid, 0);
  }
  else if (gTeam[playerid] == 1)
  {
    SetPlayerTeam(playerid, 1);
  }
I'm confused... what's that?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)