K/D ratio in sql database - 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)
+--- Thread: K/D ratio in sql database (
/showthread.php?tid=643664)
K/D ratio in sql database -
OliverK - 24.10.2017
K/D ratio in sql database
?
Re: K/D ratio in sql database -
ISmokezU - 24.10.2017
Isn't that just Kill divided by Deaths? It doesn't even need to be saved, just divide the player arrays.
Re: K/D ratio in sql database -
Danisoni - 24.10.2017
I dont rly understand what you want, something like this or?
Код:
new string[ 64 ], Float:ratio;
if ( kills[playerid] > deaths[playerid] ) {
ratio = float(kills[playerid])/float(deaths[playerid]);
format(string,sizeof(string),"Ratio: %0.2f - Kills to deaths.", ratio);
SendClientMessage( playerid, -1, string );
} else if ( kills[playerid] < deaths[playerid] ) {
ratio = float(deaths[playerid])/float(kills[playerid]);
format(string,sizeof(string),"Ratio: %0.2f - Deaths to kills.", ratio);
SendClientMessage( playerid, -1, string );
}