16.02.2014, 00:52
Try(but preserve your actual code cus I didnt test this):
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if (GodMode[playerid] == 1)
{
SetPlayerHealth(playerid, 0x7F800000);
}
else
{
if(issuerid != INVALID_PLAYER_ID)
{
if (gTeam[playerid] == gTeam[issuerid])
{
new Float:Health,Float:Armour;
GetPlayerHealth(playerid,Health);
GetPlayerArmour(playerid,Armour);
if(amount < Health+Armour) //avoid double kill for playerid
{
if(Armour>0.0) {
Armour -= amount/2.0;
if(Armour < 0.0) Health += Armour;
}
else {
Health -= amount/2.0;
}
SetPlayerArmour(playerid,(Armour>0)?(Armour):(0.0));
SetPlayerHealth(playerid, Health);
}
}
}
}
return 1;
}