10.06.2012, 20:25
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID)
{
new Float:health;
GetPlayerHealth(playerid, health);
if(weaponid == 7)
SetPlayerHealth(playerid,health-10);
if(weaponid == 8)
SetPlayerHealth(playerid,health-10);
if(weaponid == 4)
SetPlayerHealth(playerid,health-30);
if(weaponid == 3)
SetPlayerHealth(playerid,health-11);
if(weaponid == 5)
SetPlayerHealth(playerid,health-11);
if(weaponid == 23)
SetPlayerHealth(playerid,health-20);
if(weaponid == 24)
SetPlayerHealth(playerid,health-70);
if(weaponid == 22)
SetPlayerHealth(playerid,health-20);
if(weaponid == 25)
SetPlayerHealth(playerid,health-60);
if(weaponid == 26)
SetPlayerHealth(playerid,health-48);
if(weaponid == 27)
SetPlayerHealth(playerid,health-100);
if(weaponid == 28)
SetPlayerHealth(playerid,health-30);
if(weaponid == 29)
SetPlayerHealth(playerid,health-35);
if(weaponid == 30)
SetPlayerHealth(playerid,health-42);
if(weaponid == 31)
SetPlayerHealth(playerid,health-48);
if(weaponid == 32)
SetPlayerHealth(playerid,health-32);
if(weaponid == 33)
SetPlayerHealth(playerid,health-40);
if(weaponid == 34)
SetPlayerHealth(playerid,health-100);
if(weaponid == 33)
SetPlayerHealth(playerid,health-40);
if(weaponid == 33) SetPlayerHealth(playerid,health-40);
}
return 1;
}
Код:
SetPlayerHealth(playerid,health-40);
Код:
SetPlayerHealth(playerid,TotalHealth-40);
that if I'm shooting someone it will give him -40 from his health and his armor together..
currently, if a player has 100% armor, and 100% HP, and the code is
Код:
SetPlayerHealth(playerid,health-40);
which mean according to this idiot system: a player can die with 0 HP and 50 armor.
I want it to low his total health, like if he got armor 100 and HP 100 so it will lower -40 from his armor first.
Kind of a problem, does anyone knows what can I do? I'm a begginer, do not expect me for a lot.