29.09.2012, 18:19
Basically I check if a team A is shooting team A, if is, give back HP to victim player. However, if team B shoot team A victim and he loose lets say 60 hp, having 40 hp left, if a team A member shoots the other team A member now, he gets back his HP.. How do I solve this?
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(gTeam[issuerid] == TEAM_COP && gTeam[playerid] == TEAM_COP && weaponid >= 0 && weaponid <= 42)
{
new Float:hp;
GetPlayerHealth(playerid, hp);
SetPlayerHealth(playerid, hp + amount);
GameTextForPlayer(issuerid, "~r~Dont attack teammates", 5000, 1);
}
else
{
format(pHitDamage, sizeof(pHitDamage), "-%.0f HP", amount);
SetPlayerChatBubble(playerid, pHitDamage, 0x09D33FAA, 150.0,2500);
}
return 1;
}