SA-MP Forums Archive
Ratio - 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: Ratio (/showthread.php?tid=172741)



Ratio - jaksimaksi - 31.08.2010

Hi, how can i make a script of ratio? i have a kills and deaths textdraw and i want to make another one who shows ratio, cant find on search cuz the stupid motherfucking search is not working fine


Re: Ratio - mrcoolballs - 31.08.2010

pawn Код:
format(str,sizeof(str),"Ratio: %0.2f",Kills/Deaths);



Re: Ratio - LarzI - 31.08.2010

Ratio is kills divided by deaths, so this is easy made.

Make the textdraw, update it onplayerdeath with kills/deaths

pawn Код:
new tdstring[5];
new Float:ratio = killsvar/deathsvar;
format( tdstring, sizeof( tdstring ), "%f", ratio );
TextDrawSetString( textdraw, tdstring );
Very fast, and not very professional, but oh well

EDIT: too slow