SA-MP Forums Archive
Problem.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem.. (/showthread.php?tid=83463)



Problem.. - Dreftas - 25.06.2009

pawn Код:
pInfo[StatsID][Ratio] = pInfo[StatsID][Kills] / pInfo[StatsID][Deaths];
Kills = 6
Deaths = 12
Kills / Deaths = 0.5
Script shows 0.000000

I make this:
pawn Код:
format(StatsStr1,128,"Ratio: %f",pInfo[StatsID][Ratio]);
tried everything, nothing helped :/


Re: Problem.. - abhinavdabral - 25.06.2009

show the declarations of all the used variables


Re: Problem.. - Dreftas - 25.06.2009

Quote:
Originally Posted by ۞●•λвнiиаv•●۞
show the declarations of all the used variables
What do you mean?
(my english sucks )


Re: Problem.. - abhinavdabral - 25.06.2009

i mean where u have written
Код:
new Something[Whatever];
paste them all


Re: Problem.. - Dreftas - 25.06.2009

pawn Код:
enum Info
{
    Kills,
Deaths,
    Float:Ratio,
}
new pInfo[MAX_PLAYERS][Info];



Re: Problem.. - abhinavdabral - 25.06.2009

ok so i tried to repair it..now it should work

Код:
pInfo[StatsID][Ratio] = floatdiv(float(pInfo[StatsID][Kills]) ,float(pInfo[StatsID][Deaths]));
format(StatsStr1,128,"Ratio: %f",pInfo[StatsID][Ratio]);



Re: Problem.. - Dreftas - 25.06.2009

Thx =]


Re: Problem.. - abhinavdabral - 25.06.2009

Your most welcome Dreftas