TOP KILLS - 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: TOP KILLS (
/showthread.php?tid=192050)
TOP KILLS -
NewbBeginner - 21.11.2010
I have kills saved in Mysql database.
How can I display it with /topkills command ?
Re: TOP KILLS -
NewbBeginner - 21.11.2010
I shouldn't bump, But i need it.
Re: TOP KILLS -
dark_clown - 21.11.2010
well i dont know if u use vars or enums so :/
try making some vars then OnPlayerDeath do var[killerid] ++
then make a command ex:
/mykills
format(string,sizeof(string),"%d",var[playerid]
sendclientmessage
i think i wasnt clear with that xD
Re: TOP KILLS -
TheXIII - 21.11.2010
SQL MAX()
Or if you want to display TOP3 for example, you could combine
SQL TOP and
SQL ORDER BY
Re: TOP KILLS -
NewbBeginner - 21.11.2010
Example for me ? and how to display it, Command ?
Re: TOP KILLS -
TheXIII - 21.11.2010
Quote:
Originally Posted by NewbBeginner
Example for me ? and how to display it, Command ?
|
Sample of SQL Query. Might work, might not.
Код:
SELECT PlayerName FROM Players WHERE MAX(KillCount)
I will not explain on how to use SQL and its plugins, or how to format strings. There is plenty of information on that available. Also I will not script it for you.
Re: TOP KILLS -
NewbBeginner - 21.11.2010
So:
Код:
SELECT Name FROM `players` WHERE MAX(Kills)
players is table, Name is pName, and Kills field displays fields, but how to dispaly TOP 5 ?
Re: TOP KILLS -
TheXIII - 21.11.2010
Quote:
Originally Posted by NewbBeginner
So:
Код:
SELECT Name FROM `players` WHERE MAX(Kills)
players is table, Name is pName, and Kills field displays fields, but how to dispaly TOP 5 ?
|
Код:
SELECT TOP 5 Name From players ORDER BY Kills DESC
Re: TOP KILLS -
mmrk - 21.11.2010
Just order by DESC and display 5 lines?