19.12.2009, 10:09
Hello guys, i have a strange problem...
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:
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 ?
pawn Код:
stock Ratio(input1,input2)
{
if(input1 > 0 && input2 > 0)
{
new output;
output = input1 / input2;
return output;
}
else return false;
}
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);
but it always returns 0
my example was input1 = 12 and input2 = 6
12/6 = 2
anyone knows what to do ?