GetBoneName
#1

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;
}
Here it is in an array if you want it (@hub)

pawn Код:
new BoneName[10][10] =
{
    "", "", "", "Torso", "Groin", "Left Arm", "Right Arm", "Left Leg", "Right Leg", "Head"
};
Example with Array:

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;
}
Example:

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;
}
Reply


Messages In This Thread
GetBoneName - by Ari - 17.01.2014, 08:02
Re: GetBoneName - by M3HR4N - 17.01.2014, 08:04
Re: GetBoneName - by Flake. - 17.01.2014, 08:05
Re: GetBoneName - by hub4 - 17.01.2014, 08:06
Re: GetBoneName - by Ari - 17.01.2014, 08:07
Re: GetBoneName - by Plovix - 18.01.2014, 16:28
Re: GetBoneName - by Basssiiie - 18.01.2014, 16:56
Re: GetBoneName - by Omar55555 - 18.01.2014, 17:02
Re: GetBoneName - by Ari - 18.01.2014, 17:20

Forum Jump:


Users browsing this thread: 2 Guest(s)