Armor Problem
#1

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

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

Код:
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?
Reply
#4

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

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.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)