10.11.2012, 02:35
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.