21.07.2016, 20:04
Hello, I have a small problem when creating a script in my server, it works all good with one small exception, when the player B is under the custom made damage of a weapon, he won't take any damage at all. I will post the script under me.
PHP код:
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.
}
}
}
}