public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
new
Float:health,
Float:armour
;
GetPlayerHealth(playerid, health);
GetPlayerArmour(playerid, armour);
switch(weaponid)
{
case 24: // Desert Eagle weapon ID
{
switch(armour)
{
case 0:
{
switch(bodypart)
{
case 3: SetPlayerHealth(playerid, health - 70); // Torso.
case 4: SetPlayerHealth(playerid, health - 65); // Groin.
case 5: SetPlayerHealth(playerid, health - 40); // Left Arm.
case 6: SetPlayerHealth(playerid, health - 40); // Right Arm.
case 7: SetPlayerHealth(playerid, health - 40); // Left Leg.
case 8: SetPlayerHealth(playerid, health - 40); // Right Leg.
case 9: SetPlayerHealth(playerid, health - 100); // Head.
}
}
default:
{
switch(bodypart)
{
case 3: SetPlayerArmour(playerid, health - 70); // Torso.
case 4: SetPlayerArmour(playerid, health - 65); // Groin.
case 5: SetPlayerArmour(playerid, health - 40); // Left Arm.
case 6: SetPlayerArmour(playerid, health - 40); // Right Arm.
case 7: SetPlayerArmour(playerid, health - 40); // Left Leg.
case 8: SetPlayerArmour(playerid, health - 40); // Right Leg.
case 9: SetPlayerArmour(playerid, health - 100); // Head.
}
}
}
}
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost) { Your Code... return 1; }
OnPlayerTakeDamage means when player take damage try this include.
https://sampforum.blast.hk/showthread.php?tid=195439 and use it like Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost) { Your Code... return 1; } |