SA-MP Forums Archive
[Ajuda] Diminuir 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] Diminuir Dano das armas (/showthread.php?tid=378201)



Diminuir Dano das armas - Micael_Vitor - 16.09.2012

peguei um codigo aki do forum mesmo que deixa o LAG na skin sу que fica muito easy de matar queria retirar 30% de dano de todas as armas pq se nao fica um cъ

Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid) {
    new Float: Life[2];
    GetPlayerHealth(damagedid, Life[0]);
    GetPlayerArmour(damagedid, Life[1]);
    if(Life[1]) {
        if(amount > Life[1]) {
            Life[0] = Life[0] - (amount - Life[1]);
            SetPlayerArmour(damagedid, 0.0);
            SetPlayerHealth(damagedid, Life[0]);
            return 1;
        }
        Life[1] = Life[1] - amount;
        SetPlayerArmour(damagedid, Life[1]);
    } else {
       Life[0] = Life[0] - amount;
        SetPlayerHealth(damagedid, Life[0]);
    }
    return 1;
}



Re: Diminuir Dano das armas - FenixBorn - 16.09.2012

no topico que eu postei isso aew ja esta a soluзгo:

amount = amount/3;


Re: Diminuir Dano das armas - Micael_Vitor - 16.09.2012

desculpa a inguinorancia mais aonde mudo a quantidade ? (amount)


Re: Diminuir Dano das armas - FenixBorn - 16.09.2012

Ele divide o dano das armas por 3 '_'
se era 9 fica 3
voce pode colocar 2 tbm,,ou outro valor,,ele irб dividir o dano pelo valor especificado


Re: Diminuir Dano das armas - Micael_Vitor - 16.09.2012

sim isto eu sei so queria saber como mudo o valor no codigo rsrs

to tentando aki mais bate erro/warning x.x
aki vai


public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
new Float:Life, Float:Coleete, Floatano;
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);
}
return 1;
}