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;
}
new BoneName[10][10] =
{
"", "", "", "Torso", "Groin", "Left Arm", "Right Arm", "Left Leg", "Right Leg", "Head"
};
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;
}
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;
}
stock GetBoneName(bodypart) { new BoneName[10]; switch(bodypart) { case 3: BoneName = "Torso"; case 4: BoneName = "Groin"; case 5: BoneName = "Left Arm"; case 6: BoneName = "Right Arm"; case 7: BoneName = "Left Leg"; case 8: BoneName = "Right Leg"; case 9: BoneName = "Head"; } return BoneName; }
You know you can just do this (for static strings)?
![]() Код:
stock GetBoneName(bodypart) { new BoneName[10]; switch(bodypart) { case 3: BoneName = "Torso"; case 4: BoneName = "Groin"; case 5: BoneName = "Left Arm"; case 6: BoneName = "Right Arm"; case 7: BoneName = "Left Leg"; case 8: BoneName = "Right Leg"; case 9: BoneName = "Head"; } return BoneName; } |