Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local OnChat, GetList
- local low, high = 1, 50
- function OnChat(event, pPlayer, pMessage, pType, pLanguage, pMisc)
- local msg = pMessage:lower()
- if(msg:find("[.!]top .+") == 1) then
- local Amount = tonumber(msg:match("[.!]top (.+)"))
- if(Amount) then
- local str = tostring(pPlayer)
- if(Amount <= high and Amount >= low) then
- local Q = CharDBQuery("SELECT name, pvprank FROM Characters ORDER BY pvprank DESC LIMIT "..Amount)
- if(Q) then
- for i = 1, Q:GetRowCount() do
- pPlayer:SendBroadcastMessage(i..". "..Q:GetColumn(0):GetString().." - "..Q:GetColumn(1):GetULong().." kills")
- Q:NextRow()
- end
- else
- pPlayer:SendBroadcastMessage("No players found")
- end
- else
- pPlayer:SendBroadcastMessage("Bad value. "..low.."-"..high.." accepted.")
- end
- end
- return false
- end
- end
- RegisterServerHook(16, OnChat)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement