SA-MP Forums Archive
Anti-lag shoot - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Anti-lag shoot (/showthread.php?tid=366719)



Anti-lag shoot - Dan. - 07.08.2012

DELETE THIS


Re: Anti-lag shoot - you10 - 07.08.2012

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    new Float:Damage;
    GetPlayerArmour(damagedid, Damage);
    if(Damage > 0)
    {
        if(amount > Damage)
        {
            SetPlayerArmour(damagedid, 0);
        }
        else
        {
            SetPlayerArmour(damagedid, Damage-amount);
        }
    }
    else
    {
        GetPlayerHealth(damagedid, Damage);
        SetPlayerHealth(damagedid, Damage-amount);
    }
    return 1;
}
This should work as GetPlayerArmour doesn't return the value, it puts it in the Damage variable.