Problem with Ratio
#1

Hello guys, i have a strange problem...

pawn Код:
stock Ratio(input1,input2)
{
    if(input1 > 0 && input2 > 0)
    {
        new output;
        output = input1 / input2;
        return output;
    }
    else return false;
}
thats my ratio code, it should divide 2 values and return the result.

then i wanted to put that in a string to test it:

pawn Код:
new Joinstr[128];
    format(Joinstr,sizeof(Joinstr),"-PlayerJoin | %s connected to the San Andreas Wars (Rank: %.2f)",pName(playerid),Ratio(12,6));
    SendClientMessageToAll(THIAZ_GREY,Joinstr);
i just wanted to test it so don't be hard.

but it always returns 0

my example was input1 = 12 and input2 = 6
12/6 = 2



anyone knows what to do ?
Reply


Messages In This Thread
Problem with Ratio - by thiaZ_ - 19.12.2009, 10:09
Re: Problem with Ratio - by saiberfun - 19.12.2009, 10:20
Re: Problem with Ratio - by _[HuN]_Epsilon_ - 19.12.2009, 10:52
Re: Problem with Ratio - by thiaZ_ - 19.12.2009, 11:06
Re: Problem with Ratio - by saiberfun - 19.12.2009, 11:11
Re: Problem with Ratio - by _[HuN]_Epsilon_ - 19.12.2009, 11:19

Forum Jump:


Users browsing this thread: 1 Guest(s)