SA-MP Forums Archive
[ajuda] baixa dano das armas - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [ajuda] baixa dano das armas (/showthread.php?tid=346741)



[ajuda] baixa dano das armas - coringa_smith157 - 29.05.2012

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
    new Float:Life, Float:Colete, Float:Dano;
    GetPlayerArmour(damagedid, Colete);
    GetPlayerHealth(damagedid, Life);
    if(Colete > 0)
    {
        if(amount > Colete)
        {
            Dano = amount - Colete;
            Life = Life - Dano;
            SetPlayerArmour(damagedid, 0.0);
            SetPlayerHealth(damagedid, Life);
            return 1;
        }
        Colete = Colete - amount;
        SetPlayerArmour(damagedid, Colete);
    }
    if(Colete < 1)
    {
        Life = Life - amount;
        SetPlayerHealth(damagedid, Life);
    }
    return 1;
}
quero colcoa apra mata com 3 tiros me ajuda ai galeras


Re: [ajuda] baixa dano das armas - paulor - 29.05.2012

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
    new Float:Life, Float:Colete, Float:Dano;
    GetPlayerArmour(damagedid, Colete);
    GetPlayerHealth(damagedid, Life);
    amount = amount/2;
    if(Colete > 0)
    {
        if(amount > Colete)
        {
            Dano = amount - Colete;
            Life = Life - Dano;
            SetPlayerArmour(damagedid, 0.0);
            SetPlayerHealth(damagedid, Life);
            return 1;
        }
        Colete = Colete - amount;
        SetPlayerArmour(damagedid, Colete);
    }
    if(Colete < 1)
    {
        Life = Life - amount;
        SetPlayerHealth(damagedid, Life);
    }
    return 1;
}
Ve se agrada!