[Talk] Comando mute/desmute
2 participantes
- EmpregueteBanido
- King Carteira : 0
Reputação : 4
Eu sou : Programmer
Tópicos : 10
Data de Cadastro : 27/09/2015
[Talk] Comando mute/desmute
27/9/2015, 17:30
Em talkactions/script
adicione um arquivo em lua, e renomeie para muteplayer.lua, e adicione isso:
em talkactions/talkactions.xml, adicione essa tag:
Em creaturescript/script, crie um arquivo em lua e renomeie para mute_check.lua, e adicione isso dentro dele:
em creaturescript/creaturescript.xml, adicione essa tag:
Comandos:
adicione um arquivo em lua, e renomeie para muteplayer.lua, e adicione isso:
- Spoiler:
- local v = {}
for k = 1, 100 do
table.insert(v, createConditionObject(CONDITION_MUTED))
setConditionParam(v[k], CONDITION_PARAM_TICKS, k*60*1000)
end
function onSay(cid, words, param)
if (words == "/mute") then
local t = string.explode(param, ",")
if param == '' then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end
local player,time,pid = getPlayerByName(t[1]),t[2],getPlayerByNameWildcard(t[1])
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você mutou o jogador "..t[1].." por "..time.." minutos.")
doAddCondition(player, v[tonumber(time)])
setPlayerStorageValue(player, 90000, os.time()+time*60)
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você foi mutado por "..time.." minutos.")
elseif (words == "/desmute") then
if param == '' then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end
local player = getPlayerByNameWildcard(param)
if(not player)then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") return true end
if getCreatureCondition(player, CONDITION_MUTED) == false then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "este jogador não está mutado.") return true end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você desmutou o jogador "..param..".")
doRemoveCondition(player, CONDITION_MUTED)
setPlayerStorageValue(player, 90000, -1)
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você foi desmutado.")
end
return true
end
em talkactions/talkactions.xml, adicione essa tag:
- Spoiler:
- <talkaction log="yes" words="/mute;/desmute" access="2" event="script" value="muteplayer.lua"/>
Em creaturescript/script, crie um arquivo em lua e renomeie para mute_check.lua, e adicione isso dentro dele:
- Spoiler:
- local v = {}
for k = 1, 100000 do
table.insert(v, createConditionObject(CONDITION_MUTED))
setConditionParam(v[k], CONDITION_PARAM_TICKS, k*1000)
end
function onLogin(cid)
if getPlayerStorageValue(cid, 90000) >= os.time() then
doAddCondition(cid, v[tonumber(getPlayerStorageValue(cid, 90000) - os.time())])
end
return TRUE
end
em creaturescript/creaturescript.xml, adicione essa tag:
- Spoiler:
- <event type="login" name="MutePlayer" event="script" value="mute_check.lua"/>
Comandos:
- Spoiler:
- Comando:
/mute NOME,MINUTOS
/desmute NOME
- [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]:
Re: [Talk] Comando mute/desmute
27/9/2015, 17:39
Parabéns pela organização do tópico! você recebeu 1 de reputação pela organização do tópico e publicação.
- EmpregueteBanido
- King Carteira : 0
Reputação : 4
Eu sou : Programmer
Tópicos : 10
Data de Cadastro : 27/09/2015
Re: [Talk] Comando mute/desmute
27/9/2015, 17:42
Obrigado
Permissões neste sub-fórum
Não podes responder a tópicos
|
|