AL
talkaction

Lista de Staff online

Por Alexclusive, 21 de abr. de 2013 em Actions e Talkactions

script
14
1.8k
AlexclusiveA
21 de abril de 2013 às 13:44

Uma talkaction que vai incrementar um pouco mais seu servidor.

 

!staff (se tiver alguém online)



52uBmza.png

 

(se não tiver alguém online)

ljM79yf.png

 

Em data/talkactions/talkactions.xml:


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

 

Agora em data/talkactions/scripts: crie um arquivo chamado staff.lua e cole dentro:


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

 

Bom uso! (Créditos: Hiromath)

21 de abril de 2013 às 13:51

Puts man,muito bom esse script,mals não da pra da rep,limite,mas o script é MUITO BOM

LuckinhaSanL
21 de abril de 2013 às 14:04

Não vejo utilidades, é pra isso que server o chat Help, pra

tirar dúvidas. Se um membro da staff estiver online, ele responderá

no help, tirando a dúvida de tal player.

AlexclusiveA
21 de abril de 2013 às 14:06

Puts man,muito bom esse script,mals não da pra da rep,limite,mas o script é MUITO BOM

 

Vlw chegado!

Aproveite :)

caoticC
21 de abril de 2013 às 14:12

Muito legal o criado do script fazer uma busca na database sendo que ele pode usar um for em getPlayerOnline.

str = "Equipe On"
for i =1, #getPlayersOnline() do
local player = getPlayersOnline()[i]
if getPlayerGroupId(player) > 2 then
str = str..getPlayerName(player)
end
doShowTextDialog(cid, 1397, str)
end

Editado Abril 21 por caotic

KaboFlow29K
25 de abril de 2013 às 03:39

Muto Bom Mano :D

AlexclusiveA
25 de abril de 2013 às 08:43

Brigado cara :)

WebTutoriaisW
25 de abril de 2013 às 08:51

Para Alguns Servidores , Realmente Tem Utilidade , Parabéns ..

AdilsonHackerA
25 de abril de 2013 às 13:18

Gostei Pcr Será muito útil Rep +

 

Abraços !

AlexclusiveA
25 de abril de 2013 às 13:48

Obrigado Adilson!

 

Abraço :)

drakylucasD
26 de abril de 2013 às 14:07

até funciona, mas ao invez de verificar todos players do banco de dados que estão online pela query, nao era mais facil fazer isso?

for _, pid in ipairs(getPlayersOnline()) do

 

end

 

e apenas verificar o acesso? =p

FenixBorgesF
26 de abril de 2013 às 14:16

Perfeito brother..

Assim os players não vão precisar ficar no Help-Chat perguntando:

"Lord Of War [57]: Algum tutor ai? responde por favor!"

Eles simplesmente vai executar esse comando e ver quem ta online

da Staff, para ajuda-lo.

REP+ póste mais coisas úteis!

pokemonfox123P
27 de abril de 2013 às 00:37

Velho Muito Foda Vai ser de Bom Uso Para Os Caras

SkymagnumS
27 de abril de 2013 às 00:47

Script bacana, estou sem rep no momento quando liberar eu do, mas não há necessidade de manuseio de db neste script.

 

17AHwqzz[/pastebin]

Editado Abril 27 por Skymagnum