Em, data\talkactions\talkaction.xml
Adicione:
<talkaction words="!comandos" event="script" value="comandos.lua"/>
Em, data\talkactions\scripts
Crie um arquivo com o nome de comandos.lua
Adicione:
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
local tmp = talk.words:sub(1, 1):trim()
if((config.ingameGuilds or (talk.functionName ~= "guildjoin" and talk.functionName ~= "guildcreate")) and (tmp == "!" or tmp == "/")) 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
Pronto agora para usar o comando utilize !comandos.
Flw :*