17.01.2014, 08:02
pawn Код:
stock GetBoneName(bodypart)
{
new BoneName[10];
switch(bodypart) {
case 3: format(BoneName, sizeof(BoneName), "Torso");
case 4: format(BoneName, sizeof(BoneName), "Groin");
case 5: format(BoneName, sizeof(BoneName), "Left Arm");
case 6: format(BoneName, sizeof(BoneName), "Right Arm");
case 7: format(BoneName, sizeof(BoneName), "Left Leg");
case 8: format(BoneName, sizeof(BoneName), "Right Leg");
case 9: format(BoneName, sizeof(BoneName), "Head");
}
return BoneName;
}
pawn Код:
new BoneName[10][10] =
{
"", "", "", "Torso", "Groin", "Left Arm", "Right Arm", "Left Leg", "Right Leg", "Head"
};
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
new szString[128], GunName[32];
GetWeaponName(weaponid, GunName, sizeof(GunName));
format(szString, sizeof(szString), "* You shot %s in the %s with a %s, you dealt %.0f damage.", GetPlayerNameEx(playerid), BoneName[bodypart], GunName, amount);
SendClientMessage(issuerid, COL_GREY, szString);
return 1;
}
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
new szString[128], GunName[32];
GetWeaponName(weaponid, GunName, sizeof(GunName));
format(szString, sizeof(szString), "* You shot %s in the %s with a %s, you dealt %.0f damage.", GetPlayerNameEx(playerid), GetBoneName(bodypart), GunName, amount);
SendClientMessage(issuerid, COL_GREY, szString);
return 1;
}