Loop Help?
#10

pawn Код:
stock GetPlayerRankNumber(playerid, exp)
{
    new
        i = -1,
        exp = GetPlayerScore(playerid);
    ;
    while((++i < sizeof Ranks) && (exp < Ranks[i][RankXP]))
    {
        if( exp > Ranks[i][RankXP])
        {
            i++;
            if(exp < Ranks[i][RankXP])
            {
                Ranks[playerid][RankNumber] = Ranks[i-1][RankXP];
            }
        }
        return Ranks[playerid][RankNumber];
    }
    if(i == sizeof Ranks)
    {
        return printf("Warning: Experience must match at least the lowest rank (%d / %d)", exp, Rank[0][RankXp]);
    }
}
Would This Work?
Reply


Messages In This Thread
All my Questions - by newbie scripter - 08.12.2013, 11:42
Re: Loop Help? - by Voxel - 08.12.2013, 11:55
Re: Loop Help? - by newbie scripter - 08.12.2013, 12:30
Re: Loop Help? - by Voxel - 08.12.2013, 12:52
Re: Loop Help? - by newbie scripter - 08.12.2013, 12:58
Re: Loop Help? - by Voxel - 08.12.2013, 13:05
AW: Loop Help? - by Nero_3D - 08.12.2013, 13:11
Re: Loop Help? - by newbie scripter - 08.12.2013, 13:30
Re: Loop Help? - by Stevo127 - 08.12.2013, 13:40
Re: Loop Help? - by newbie scripter - 08.12.2013, 14:31

Forum Jump:


Users browsing this thread: 2 Guest(s)