29.12.2016, 08:58
Do everyone (including yourself) a favor and learn how to not code terrily, read some tutorials (you had tons of redundant code, used if only instead of if-else / switch and you had no proper indentation, math mistakes (integer + float, works but is slower))
Also, update your a_samp.inc which you can find in the package at http://www.sa-mp.com/download.php
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
new Float:HP;
GetPlayerHealth(playerid, HP);
switch(weaponid)
{
case 4: SetPlayerHealth(playerid, HP-30.0);
case 22: SetPlayerHealth(playerid, HP-25.0);
case 32: SetPlayerHealth(playerid, HP-25.0);
case 28: SetPlayerHealth(playerid, HP-25.0);
case 30: SetPlayerHealth(playerid, HP-30.0);
case 31: SetPlayerHealth(playerid, HP-21.0);
case 34: SetPlayerHealth(playerid, HP-70.0);
case 29: SetPlayerHealth(playerid, HP-25.0);
case 25: SetPlayerHealth(playerid, HP-40.0);
}
if(isseruid != INVALID_PLAYER_ID)
{
if(isValidWeaponForSpecialHit(weaponid))
{
switch(bodypart)
{
case 3: sInfo[playerid][Chest] += 1;
case 4: sInfo[playerid][Crotch] += 1;
case 5: sInfo[playerid][LArm] += 1;
case 6: sInfo[playerid][RArm] += 1;
case 7: sInfo[playerid][LLeg] += 1;
case 8: sInfo[playerid][RLeg] += 1;
case 9:
{
SetPlayerHealth(playerid, HP-70.0);
sInfo[playerid][Head] += 1;
}
}
}
}
}
isValidWeaponForSpecialHit(weaponid)
{
return (weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 || weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34);
}