[Ajuda] Diminuir Dano das armas
#1

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;
}
Reply
#2

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

amount = amount/3;
Reply
#3

desculpa a inguinorancia mais aonde mudo a quantidade ? (amount)
Reply
#4

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
Reply
#5

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)