pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
new Float:Life, Float:Coleete, Float:Dano;
PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
GetPlayerArmour(damagedid, Coleete);
GetPlayerHealth(damagedid, Life);
if(Coleete > 0)
{
if(amount > Coleete)
{
Dano = amount - Coleete;
Life = Life - Dano;
SetPlayerArmour(damagedid, 0.0);
SetPlayerHealth(damagedid, Life);
return 1;
}
Coleete = Coleete - amount;
SetPlayerArmour(damagedid, Coleete);
}
if(Coleete < 1)
{
Life = Life - amount;
SetPlayerHealth(damagedid, Life);
}
/*if(IsPlayerAimingTargetBodyPart(playerid, damagedid, 1))
{
PlayAudioStreamForPlayer(playerid, "http://introserver.ueuo.com/HeadShot.mp3");
GameTextForPlayer(damagedid, "~r~HEAD ~w~SHOT", 2000, 0);
GameTextForPlayer(playerid, "~r~HEAD ~w~SHOT", 2000, 0);
SetPlayerHealth(damagedid, -1);
}*/
new s[20];
format(s, 20, "+Dano %.0f", amount);
TextDrawSetString(GiveDamage[playerid], s);
TextDrawShowForPlayer(playerid, GiveDamage[playerid]);
//PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
SetTimerEx("DestruirTextoDraw", 1000, false, "i", playerid);
if(GetPlayerTeam(playerid) == MinhaGang[playerid]) // Troque pela variбvel que define as equipes.
{
return 0;
}
return 1;
}