Minor help.(REPLY Please)
#2

Well there are a lot of ways, here are the easiest
In case you didn't use the fonctions SetPlayerTeam and GetPlayerTeam,and used gTeam instead use them, its the best way to prevent Team Kill
Example:
pawn Код:
OnPlayerSpawn(playerid)
{
  if(gTeam[playerid] == TEAM_ONE)
  {
   SetPlayerTeam(playerid, 1);
  }
  else if (gTeam[playerid] == TEAM_TWO)
  {
   SetPlayerTeam(playerid, 2);
  }
//ect..................
  return 1;
}
And there is an other simple way to do it using OnPlayerTakeDamage CallBack
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID && GetPlayerTeam(playerid) == GetPlayerTeam(issuerid))return 1;
    return 1;
}
And in case you use gTeam
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID && gTeam[playerid] == gTeam[issuerid])return 1;
    return 1;
}
Reply


Messages In This Thread
Minor help.(REPLY Please) - by Strier - 22.12.2012, 17:58
Re: Minor help.(REPLY Please) - by DaRk_RaiN - 22.12.2012, 19:14

Forum Jump:


Users browsing this thread: 1 Guest(s)