SA-MP Forums Archive
Armor Problem - 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: Armor Problem (/showthread.php?tid=399802)



Armor Problem - Blackazur - 15.12.2012

Hello, i have the Problem that sometimes when a Player hit a Player there have Armour, the Armour refill automatic, can everyone say me how to fix that?

Here the OnPlayerTakeDamage with the Armour:

Код:
new Float:armour;
        GetPlayerArmour(playerid,armour);
Код:
if(armour > 0.0)
                {
                    SetPlayerArmour(playerid,armour-50.0);
                }



Re: Armor Problem - willsuckformoney - 15.12.2012

I see no problems here, it has to be somewhere else.


AW: Armor Problem - Blackazur - 15.12.2012

Код:
case 9:
                    {
                       if(PlayerMoney[playerid] < 20000) return SendClientMessage(playerid,COLOR_RED,"You need $20000!");

                       GivePlayerMoneyEx(playerid,-20000);
                       SetPlayerArmour(playerid, 99.0);
                       format(str,144,"«| %s bought Armour using /shop|»",PlayerName[playerid]);
                       SendClientMessageToAll(COLOR_ORANGE,str);
                     }
Maybe here?


Re: Armor Problem - park4bmx - 15.12.2012

by the look of it, it buys you the armor , somewhere else.


Re: Armor Problem - maramizo - 15.12.2012

Change your script to
pawn Код:
if(armour > 0.0)
{
    if(armour > 50.0) SetPlayerArmour(playerid,armour-50.0);
    else SetPlayerArmour(playerid, 0);
}
As you're setting his armor to a negative, which sets armor to 100.