08.05.2015, 19:52
pawn Код:
new Float: dmg_bodypart, index = -1;
for (new i; i != 10; ++i)
{
if (index == -1)
{
index = 0;
dmg_bodypart = BodyPartDamage[playerid][0];
}
else if (index != -1 && BodyPartDamage[playerid][i] > BodyPartDamage[playerid][index])
{
index = i;
dmg_bodypart = BodyPartDamage[playerid][i];
}
}
if (index != -1) printf("highest damage (%f) on bodypart (%i)", dmg_bodypart, index);