• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Displaying Top Fraggers through BC from Talkaction

Extrodus

|| Blazera.net ||
Premium User
Joined
Dec 22, 2008
Messages
2,738
Solutions
7
Reaction score
541
Location
Canada
Hello there OTLanders, I have a challenge for you today! I am trying to convert a talkaction that displays the top 10 fraggers on the server through a talk action. The script will be set on a 15 minute interval to display the highscores.

Hopefully someone can through me a bit of their knowledge in exchange for some rep and credits on the server page.

Current Talk Action Code:
Code:
function onSay(cid, words, param, channel)
	local players = playersMaxAtHightscore
	local result = db.getResult("SELECT `points`, `name` FROM `players`  WHERE `group_id` = "..max_GroupID_on_Highscore.." ORDER BY `points` DESC, `name` ASC;")

	if (result:getID() ~= -1) then
		str = "# [Frags] - Name -\n"
		local i, name = 1, ""
		while TRUE do
			name = result:getDataString("name")
			if isInArray(dont_showing_names_at_highscore, name) == false then
				str = str .. "\n " .. i .. ". [" .. result:getDataInt("points") .. "] - " .. result:getDataString("name")
				i = i+1
			end
			if not(result:next()) or i > players then
				break
			end
		end
		if str ~= "" then
			doPlayerPopupFYI(cid, str)
		end
	end
	result:free()
	return TRUE
end

So as said, instead of an onSay, should be onInterval or whatever the word is to run the global event to broadcast.

Again, any help is greatly appreciated!
 
Back
Top