TOP KILLS
#1

I have kills saved in Mysql database.

How can I display it with /topkills command ?
Reply
#2

I shouldn't bump, But i need it.
Reply
#3

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
Reply
#4

SQL MAX()

Or if you want to display TOP3 for example, you could combine SQL TOP and SQL ORDER BY
Reply
#5

Example for me ? and how to display it, Command ?
Reply
#6

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.
Reply
#7

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 ?
Reply
#8

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
Reply
#9

Just order by DESC and display 5 lines?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)