• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Show a list of the online staff!

Hiromath

New Member
Joined
Jul 22, 2012
Messages
29
Reaction score
4
Hello everyone,
I am proud to release our !staff command. This will display all the staff members from Tutors to Gods with rank names.
It will not display a staff member which is in ghost!

52uBmza.png


If there are no staff members online or everyone is in /ghost it will display this:

ljM79yf.png



Put this in your Talkactions.xml:

Code:
<talkaction words="!staff" event="script" value="staff.lua"/>

Now the script:

PHP:
function onSay(cid, words, param, channel)
	local Info = db.getResult("SELECT * FROM `players` WHERE `online` = '1' AND `group_id` > 1")
	local PlayerString = "Online Staff Members:\n"
	if Info:getID() ~= -1 then
		local count, i = Info:getRows(false), 0
           repeat
		   PlayerString = PlayerString .. Info:getDataString("name") .. " - " 
		   if Info:getDataInt("group_id") == 2 then
		   PlayerString = PlayerString .. "Tutor"
		   elseif Info:getDataInt("group_id") == 3 then
		   PlayerString = PlayerString .. "Senior Tutor"	
		   elseif Info:getDataInt("group_id") == 4 then
		   PlayerString = PlayerString .. "Game Master"			
		   elseif Info:getDataInt("group_id") == 5 then
		   PlayerString = PlayerString .. "Community Manager"	
		   elseif Info:getDataInt("group_id") == 6 then
		   PlayerString = PlayerString .. "God"
			end
		 PlayerString = PlayerString .. "\n"
		   until not(Info:next())
		   		   	Info:free()
		   else
		   PlayerString = PlayerString .. "No staff online, try again later"
		   end
		   doPlayerPopupFYI(cid, PlayerString);
	return true
end


I hope you guys find this useful!


Sincerely,

Hiromath​
 
Last edited:
Lua:
local t = {
	[2] = "Tutor",
	[3] = "Senior Tutor",
	[4] = "Game Master",
	[5] = "Community Manager",
	[6] = "God"
	}
function onSay(cid, words, param, channel) 
	local Info = db.getResult("SELECT * FROM `players` WHERE `online` = '1' AND `group_id` > 1") 
	local PlayerString = "Online Staff Members:\n"
	local x, r = {}, 0
	if Info:getID() ~= -1 then 
		local count, i = Info:getRows(false), 0 
			repeat
				r = r+1
				table.insert(x[r][1],Info:getDataString("name"))
				table.insert(x[r][2], t[Info:getDataInt("group_id")])
			until not(Info:next()) 
		Info:free()
	else
		PlayerString = PlayerString .. "No staff online, try again later." 
	end
	table.sort(x, function(a, b) return a[1][2] > b[1][2] end)
	if x[1] then
		for v = 1, #x do
			PlayerString = PlayerString..x[v][1]..' - '..x[v][2]..'\n'
		end
	end
	doPlayerPopupFYI(cid, PlayerString)
return true
end
Kinda simpler and makes the list appear in order.
 
Back
Top