Что лучше использовать?
Или
C++:
new const g_arrItemSkills[] = {0, 60, 75, 85, 100, 115, 130, 140, 150, 165, 180, 195, 210}
new const g_arrViewSkills[][] = {"L-", "L", "L+", "M-", "M", "M+", "H-", "H", "H+", "P-", "P", "P+", "G"}
stock get_skill(skill)
{
for (new i; i < sizeof g_arrViewSkills; ++ i)
{
if (i && g_arrItemSkills[i] > skill)
return i - 1
else if ((!i && g_arrItemSkills[i] > skill) || i == charsmax(g_arrViewSkills))
return i
}
return 0
}
g_arrViewSkills[get_skill(bh[SKILL])], bh[SKILL]
C++:
get_skill(id, st[8], bh[12], user_skill[3])
{
get_user_stats(id, st, bh)
if (bh[HIT_RIGHTLEG +2] >= 0 && bh[HIT_RIGHTLEG +2] < 60)
copy(user_skill, charsmax(user_skill), "L-")
else if (bh[HIT_RIGHTLEG +2] >= 60 && bh[HIT_RIGHTLEG +2] < 75)
copy(user_skill, charsmax(user_skill), "L")
else if (bh[HIT_RIGHTLEG +2] >= 75 && bh[HIT_RIGHTLEG +2] < 85)
copy(user_skill, charsmax(user_skill), "L+")
else if (bh[HIT_RIGHTLEG +2] >= 85 && bh[HIT_RIGHTLEG +2] < 100)
copy(user_skill, charsmax(user_skill), "M-")
else if (bh[HIT_RIGHTLEG +2] >= 100 && bh[HIT_RIGHTLEG +2] < 115)
copy(user_skill, charsmax(user_skill), "M")
else if (bh[HIT_RIGHTLEG +2] >= 115 && bh[HIT_RIGHTLEG +2] < 130)
copy(user_skill, charsmax(user_skill), "M+")
else if (bh[HIT_RIGHTLEG +2] >= 130 && bh[HIT_RIGHTLEG +2] < 140)
copy(user_skill, charsmax(user_skill), "H-")
else if (bh[HIT_RIGHTLEG +2] >= 140 && bh[HIT_RIGHTLEG +2] < 150)
copy(user_skill, charsmax(user_skill), "H")
else if (bh[HIT_RIGHTLEG +2] >= 150 && bh[HIT_RIGHTLEG +2] < 165)
copy(user_skill, charsmax(user_skill), "H+")
else if (bh[HIT_RIGHTLEG +2] >= 165 && bh[HIT_RIGHTLEG +2] < 180)
copy(user_skill, charsmax(user_skill), "P-")
else if (bh[HIT_RIGHTLEG +2] >= 180 && bh[HIT_RIGHTLEG +2] < 195)
copy(user_skill, charsmax(user_skill), "P")
else if (bh[HIT_RIGHTLEG +2] >= 195 && bh[HIT_RIGHTLEG +2] < 210)
copy(user_skill, charsmax(user_skill), "P+")
else if (bh[HIT_RIGHTLEG +2] >= 210)
copy(user_skill, charsmax(user_skill), "G")
else
copy(user_skill, charsmax(user_skill), "L-")
}
get_skill(id, st, bh, user_skill)
user_skill, bh[HIT_RIGHTLEG +2]