Problem in stock..
#1

plz help..
Код:
stock PercentsFromNumber(number,percents)
{
        if(percents > 100) return 0;
        new string[30];
        format(string,30,"%d.%d",number/100,number%100);
        new result = floatstr(string)*percents;
        return result;
}
Reply
#2

So, what is the problem?
Reply
#3

That seems like a really bloated way to do it.
pawn Код:
stock Float:PercentsFromNumber(number, percents)
    return float(number) * (float(percents) / 100.0);
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
That seems like a really bloated way to do it.
pawn Код:
stock Float:PercentsFromNumber(number, percents)
    return float(number) * (float(percents) / 100.0);
ty bro
changed it to int with floatround.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)