How would I go about.. - 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: How would I go about.. (
/showthread.php?tid=266921)
How would I go about.. -
Luis- - 06.07.2011
Making a Kill Death Ratio mysql wise?
~ Regards, Luis.
Re: How would I go about.. -
Snipa - 06.07.2011
When you UPDATE, "%f", killsvar/deathsvar and put that integer in a new row.
Re: How would I go about.. - [L3th4l] - 06.07.2011
pawn Код:
UPDATE .. Ratio = %f..", floatdiv(kills, deaths)
Re: How would I go about.. -
Cyanide - 06.07.2011
It's as simple as a regular mathematic question. I don't know why people are calling natives to divide when SQL has its own arithmetic division operator. Here's an example query:
pawn Код:
mysql_query( "UPDATE accounts SET Ratio = '%i / %i' WHERE name = '%s'", kills, deaths, name );
Re: How would I go about.. -
Luis- - 06.07.2011
If I am correct it would be a FLOAT on the mysql table?
Re: How would I go about.. -
Luis- - 06.07.2011
Alrighty, got it working. Thanks.