14.09.2012, 23:32
pawn Код:
#define EvaluateDamage(%0); \
if (floatcmp(%0, AP) == 1) { Remain = floatsub(%0, AP); SetPlayerArmour(playerid, 0.0); \
SetPlayerHealth(playerid, HP - Remain); } \
else { SetPlayerArmour(playerid, floatsub(AP, %0)); }
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
new Float:HP, Float:AP, Float:Remain;
GetPlayerHealth(playerid, HP);
GetPlayerArmour(playerid, AP);
if(weaponid == 24) { EvaluateDamage(40); } //DesertEagle
if(weaponid == 22) { EvaluateDamage(30); } //Colt45
if(weaponid == 32) { EvaluateDamage(15); } //Tec9
if(weaponid == 28) { EvaluateDamage(15); } //Uzi
if(weaponid == 23) { EvaluateDamage(35); } //SilencedColt
if(weaponid == 31) { EvaluateDamage(37); } //M4
if(weaponid == 30) { EvaluateDamage(34); } //AK
if(weaponid == 29) { EvaluateDamage(18); } //MP5
if(weaponid == 34) { EvaluateDamage(300); } //SniperRifle
if(weaponid == 33) { EvaluateDamage(35); } //CuntGun
if(weaponid == 25) { EvaluateDamage(40); }//PumpShotgun
if(weaponid == 27) { EvaluateDamage(30); } //Spaz12
return 1;
}