Assistance with calculations, not sure why not working.
#1

pawn Код:
InfPrice(oldprice)
{
    printf("oldmoney %d", oldprice);
    if(TotalServerMoney < 7000000) return oldprice;
    new newprice, money, calc;
    printf("oldmoney %d", oldprice);
    money = (TotalServerMoney - ServerStartMoney) / ServerStartMoney; //7,000,000
    printf("ServerStartTotal %d",ServerStartMoney);
        printf("TotalServerMoneyl %d",TotalServerMoney);
    InflatPercentage = money * 100;
   
    calc = oldprice * InflatPercentage;
   
    newprice = oldprice + calc;
    printf("newmoney %d", newprice);
    return newprice;
}
pawn Код:
new Float: InflatPercentage;
The printf's show the correct inputs (oldprice, totalserver, serverstart) but won't calculate them properly, could anyone advise why?

Thanks.
Reply
#2

Integer divided by integer yields an integer.
Reply
#3

So I need to use a float to calculate?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)