FE

!commands

Por Felipefox34, 27 de mar. de 2012 em Archived

tibia
script
otserv
2
1.3k
Felipefox34F
27 de março de 2012 às 15:36

Tipo do script: Slayer Yourots v11

Protocolo (versão do Tibia): 8.40

Servidor utilizado: The Forgotten Server

Nível de experiência:

Adicionais/Informações: quero um comandos que cuando fala !commands aparece os comandos que os playes podem usar.

BeekiB
27 de março de 2012 às 18:09

Aqui está

 

talkactions.xml

 

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

 

commands.lua

 

local config = {
ingameGuilds = getBooleanFromString(getConfigValue('ingameGuildManagement'))
}
function onSay(cid, words, param, channel)
local playerAccess, t = getPlayerAccess(cid), {}
for i, talk in ipairs(getTalkActionList()) do
 if(not talk.hidden and playerAccess >= talk.access) then
  if(config.ingameGuilds or (talk.functionName ~= "guildjoin" and talk.functionName ~= "guildcreate")) then
   table.insert(t, talk)
  end
 end
end
table.sort(t, function(a, b) return a.access > b.access end)
local lastAccess, str = -1, ""
for i, talk in ipairs(t) do
 local line = ""
 if(lastAccess ~= talk.access) then
  if(i ~= 1) then
   line = "\n"
  end
  lastAccess = talk.access
 end
 str = str .. line .. talk.words .. "\n"
end
doShowTextDialog(cid, 2160, str)
return true
end