Not working/causing troubles
#1

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
        if(pData[issuerid][AdminDuty])return 1;
        new Float:health;
        new Float:armour;
        GetPlayerHealth(playerid, health);
        GetPlayerArmour(playerid, armour);
        if(weaponid == 7) {
                        if(GetPlayerArmour(playerid, armour) > 0) { SetPlayerArmour(playerid, armour-12); return 1;}
                        SetPlayerHealth(playerid,health-12); }
        if(weaponid == 8) {
                        if(GetPlayerArmour(playerid, armour) > 0) { SetPlayerArmour(playerid, armour-20); return 1;}
                        SetPlayerHealth(playerid,health-20); }
        if(weaponid == 4) {
                        if(GetPlayerArmour(playerid, armour) > 0) { SetPlayerArmour(playerid, armour-20); return 1;}
                        SetPlayerHealth(playerid,health-20); }
        if(weaponid == 3) {
                        if(GetPlayerArmour(playerid, armour) > 0) { SetPlayerArmour(playerid, armour-11); return 1;}
                        SetPlayerHealth(playerid,health-11); }
        if(weaponid == 5) {
                        if(GetPlayerArmour(playerid, armour) > 0) { SetPlayerArmour(playerid, armour-9); return 1;}
                        SetPlayerHealth(playerid,health-9); }
        if(weaponid == 23) {
                        if(GetPlayerArmour(playerid, armour) > 0) { SetPlayerArmour(playerid, armour-19); return 1;}
                        SetPlayerHealth(playerid,health-19); }
        if(weaponid == 24) {
                        if(GetPlayerArmour(playerid, armour) > 0) { SetPlayerArmour(playerid, armour-65); return 1;}
                        SetPlayerHealth(playerid,health-65); }
        if(weaponid == 22) {
                        if(GetPlayerArmour(playerid, armour) > 0) { SetPlayerArmour(playerid, armour-20); return 1; }
                        SetPlayerHealth(playerid,health-20); }
        if(weaponid == 27) {
                        if(GetPlayerArmour(playerid, armour) > 0) { SetPlayerArmour(playerid, armour-32); return 1;}
                        SetPlayerHealth(playerid,health-32); }
        if(weaponid == 28) {
                        if(GetPlayerArmour(playerid, armour) > 0) { SetPlayerArmour(playerid, armour-18); return 1;}
                        SetPlayerHealth(playerid,health-18); }
        if(weaponid == 29) {
                        if(GetPlayerArmour(playerid, armour) > 0) { SetPlayerArmour(playerid, armour-22); return 1;}
                        SetPlayerHealth(playerid,health-22); }
        if(weaponid == 30) {
                        if(GetPlayerArmour(playerid, armour) > 0) { SetPlayerArmour(playerid, armour-25); return 1;}
                        SetPlayerHealth(playerid,health-25); }
        if(weaponid == 31) {
                        if(GetPlayerArmour(playerid, armour) > 0) { SetPlayerArmour(playerid, armour-25); return 1;}
                        SetPlayerHealth(playerid,health-25); }
        if(weaponid == 32) {
                        if(GetPlayerArmour(playerid, armour) > 0) { SetPlayerArmour(playerid, armour-18); return 1;}
                        SetPlayerHealth(playerid,health-18); }
        if(weaponid == 34) {
                        if(GetPlayerArmour(playerid, armour) > 0) { SetPlayerArmour(playerid, armour-300); return 1;}
                        SetPlayerHealth(playerid,health-300); }
    }
    return 1;
}
Whenever I'm shooting a player with armour, it lowers his armour according to the damage that I wrote, but whenever I shoot him twice if he has like 30 armour and deagle takes 65 armour/health, he gets a 100% armour and it decreases his health.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)