Agora não está acontecendo absolutamente nada!
local CHANNEL_HELP = 7
Está correto com o id do seu channel?
info
Grupo: Herói
Registrado: 01/05/08
Posts: 2.6k
Reputação: +536
Gênero: Masculino

Agora não está acontecendo absolutamente nada!
local CHANNEL_HELP = 7
Está correto com o id do seu channel?
info
Grupo: Conde
Registrado: 18/07/08
Posts: 545
Reputação: +21
Char no Tibia: Nem eu sei

Em channels.xml, especifique um número para conditionId, como conditionId = "4" e use a talkaction assim
Deu esse erro amigo:
[05/08/2015 14:19:43] [Error - TalkAction Interface] [05/08/2015 14:19:43] data/talkactions/scripts/muteplayer.lua:onSay [05/08/2015 14:19:43] Description: [05/08/2015 14:19:43] (luaSetConditionParam) This function can only be used while loading the script. [05/08/2015 14:19:44] [Error - TalkAction Interface] [05/08/2015 14:19:44] data/talkactions/scripts/muteplayer.lua:onSay [05/08/2015 14:19:44] Description: [05/08/2015 14:19:44] (luaDoAddCondition) Condition not found
E aqui como está o channels.xml
<?xml version="1.0" encoding="UTF-8"?>
<channels>
<channel id="1" name="Party"/>
<channel id="2" name="Equipe" access="1"/>
<channel id="3" name="Rule Violations" logged="yes"/>
<channel id="4" name="Bate Papo" level="2"/>
<channel id="5" name="Trade" level="8" muted="120" conditionId="2" conditionMessage="Wait 2 minutes."/>
<channel id="9" name="Help" logged="yes" muted="120" conditionId="4" conditionMessage="Wait 2 minutes."/>
<channel id="65535" name="Private Chat Channel"/>
</channels>
local CHANNEL_HELP = 7
Está correto com o id do seu channel?
Coloquei ID 7, e ID 9 para testar...
aparece essa mensagem pro player
14:24 Você foi mutado por 3 minutos.
mas ele não é mutado em nenhum channel
info
Grupo: Herói
Registrado: 01/05/08
Posts: 2.6k
Reputação: +536
Gênero: Masculino

Deu esse erro amigo:
Tenta assim:
local CHANNEL_HELP = 9 local storage = 456112 local tempo = 3 -- tempo em minutos local condition = createConditionObject(CONDITION_MUTED, CHANNEL_HELP) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo * 60 * 1000) function onSay(cid, words, param) if words == "/mute" then local target = getPlayerByName(param) if not target then doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.") return false end doAddCondition(target, condition) doPlayerSendTextMessage(target, MESSAGE_INFO_DESCR, "Você foi mutado por " .. tempo .. " minutos.") setPlayerStorageValue(target, storage, 1) return true elseif words == "/unmute" then local remove = getPlayerByName(param) if remove == false then doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.") return false end if getPlayerStorageValue(remove, storage) == 1 then doRemoveCondition(remove, CONDITION_MUTED, CHANNEL_HELP) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você desmutou o jogador " .. getCreatureName(remove) .. ".") setPlayerStorageValue(target, storage, -1) else doPlayerSendCancel(cid, "O jogador " .. getCreatureName(remove) .. " nao esta mutado.") end return true end end
E usa o comando /mute Jogador
Editado Agosto 5 por Bruno Minervino
info
Grupo: Conde
Registrado: 14/04/15
Posts: 956
Reputação: +333
Gênero: Masculino

Tenta assim:
local CHANNEL_HELP = 9 local storage = 456112 local tempo = 3 -- tempo em minutos local condition = createConditionObject(CONDITION_MUTED, CHANNEL_HELP) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo * 60 * 1000) function onSay(cid, words, param) if words == "/mute" then local target = getPlayerByName(param) if not target then doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.") return false end doAddCondition(target, condition) doPlayerSendTextMessage(target, MESSAGE_INFO_DESCR, "Você foi mutado por " .. tempo .. " minutos.") setPlayerStorageValue(target, storage, 1) return true elseif words == "/unmute" then local remove = getPlayerByName(param) if remove == false then doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.") return false end if getPlayerStorageValue(remove, storage) == 1 then doRemoveCondition(remove, CONDITION_MUTED, CHANNEL_HELP) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você desmutou o jogador " .. getCreatureName(remove) .. ".") setPlayerStorageValue(target, storage, -1) else doPlayerSendCancel(cid, "O jogador " .. getCreatureName(remove) .. " nao esta mutado.") end return true end end
E usa o comando /mute Jogador
Eu testei, e ele mutou o player! mas foi em todos os canais e também quando desloga... o player perde o mute!
info
Grupo: Herói
Registrado: 01/05/08
Posts: 2.6k
Reputação: +536
Gênero: Masculino

Eu testei, e ele mutou o player! mas foi em todos os canais e também quando desloga... o player perde o mute!
Tenta assim:
local CHANNEL_HELP = 9 local storage = 456112 local tempo = 3 -- tempo em minutos local condition = createConditionObject(CONDITION_MUTED) setConditionParam(condition, CONDITION_PARAM_SUBID, CHANNEL_HELP) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo * 60 * 1000) function onSay(cid, words, param) if words == "/mute" then local target = getPlayerByName(param) if not target then doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.") return false end doAddCondition(target, condition) doPlayerSendTextMessage(target, MESSAGE_INFO_DESCR, "Você foi mutado por " .. tempo .. " minutos.") setPlayerStorageValue(target, storage, 1) return true elseif words == "/unmute" then local remove = getPlayerByName(param) if remove == false then doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.") return false end if getPlayerStorageValue(remove, storage) == 1 then doRemoveCondition(remove, CONDITION_MUTED, CHANNEL_HELP) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você desmutou o jogador " .. getCreatureName(remove) .. ".") setPlayerStorageValue(target, storage, -1) else doPlayerSendCancel(cid, "O jogador " .. getCreatureName(remove) .. " nao esta mutado.") end return true end end
Se funfar, eu faço a parte do login, para corrigir isso de relogar.
info
Grupo: Conde
Registrado: 14/04/15
Posts: 956
Reputação: +333
Gênero: Masculino

Agora não dá erro! nem o player é mutado!
info
Grupo: Conde
Registrado: 18/07/08
Posts: 545
Reputação: +21
Char no Tibia: Nem eu sei

acho que nao é possivel n
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: Kissy

Em channels.xml, especifique um número para conditionId, como conditionId = "4" e use a talkaction assim
function onSay(cid, words, param, channel, condition)
if(param == '') then
doPlayerSendTextMessage(cid, 21, "explaining the talkaction")
return true
end
local t = string.explode(param, ",")
player = getPlayerByName(t[1])
local condition = createConditionObject(CONDITION_MUTED)
if(not t[2] or t[2] == '') then
doPlayerSendTextMessage(cid, 21, "explaining the talkaction")
end
if t[2] then
time = tonumber(t[2]*1000) -- 10*1000 is 10 seconds.
if(isPlayer(player) == TRUE and getPlayerGroupId(cid) > getPlayerGroupId(player) and getPlayerFlagValue(player, PLAYERFLAG_CANNOTBEMUTED) == false) then
setConditionParam(condition, CONDITION_PARAM_SUBID, 4)
doAddCondition(player, condition)
doPlayerSendTextMessage(player, MESSAGE_STATUS_WARNING, "You have been muted by " .. getPlayerName(cid) .. " for " .. t[2] .. " seconds.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(player) .. " has been muted for " .. t[2] .. " seconds.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " is not currently online or cannot be muted.")
end
end
return true
end
info
Grupo: Artesão
Registrado: 02/11/12
Posts: 110
Reputação: +4
Char no Tibia: Druid

preciso desse script tb
info
Grupo: Conde
Registrado: 18/07/08
Posts: 545
Reputação: +21
Char no Tibia: Nem eu sei

Em channels.xml, especifique um número para conditionId, como conditionId = "4" e use a talkaction assim
da esse error:
[07/08/2015 00:58:24] [Error - TalkAction Interface] [07/08/2015 00:58:24] data/talkactions/scripts/muteplayer.lua:onSay [07/08/2015 00:58:24] Description: [07/08/2015 00:58:24] (luaSetConditionParam) This function can only be used while loading the script. [07/08/2015 00:58:24] [Error - TalkAction Interface] [07/08/2015 00:58:24] data/talkactions/scripts/muteplayer.lua:onSay [07/08/2015 00:58:24] Description: [07/08/2015 00:58:24] (luaDoAddCondition) Condition not found
info
Grupo: Artesão
Registrado: 02/11/12
Posts: 110
Reputação: +4
Char no Tibia: Druid

up
info
Grupo: Conde
Registrado: 18/07/08
Posts: 545
Reputação: +21
Char no Tibia: Nem eu sei

up
up
info
Grupo: Cavaleiro
Registrado: 18/12/12
Posts: 158
Reputação: +14
Gênero: Masculino
Char no Tibia: Lestat

up
info
Grupo: Conde
Registrado: 14/04/15
Posts: 956
Reputação: +333
Gênero: Masculino
Agora não está acontecendo absolutamente nada!