Este Script Muta o player no default,ou no help?
Default
Ex : /mute skyligh,60 eu irei ficar mutado 60 seg - 1 min
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: Kissy

Este Script Muta o player no default,ou no help?
Default
Ex : /mute skyligh,60 eu irei ficar mutado 60 seg - 1 min
Editado Julho 26 por SkyLigh
info
Grupo: Campones
Registrado: 02/07/11
Posts: 55
Reputação: +2
Gênero: Masculino

Voce pode modificar pra Channels? Tipo Help, Game-Chat...
Em talkactions/script
muteplayer.lua
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
talkactions.xml
<talkaction log="yes" words="/mute;/desmute" access="2" event="script" value="muteplayer.lua"/>
Comando:
/mute NOME,MINUTOS
/desmute NOME
Em creaturescript/script
mute_check.lua
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
creaturescript.xml
<event type="login" name="MutePlayer" event="script" value="mute_check.lua"/>
@Vodkart
cara teria como você colocar para ficar mutado apenas nos channel ? ai no servidor ele poder falar normal!
Ex: No Canal "Help, Game Chat, Trade etc..." ele ficaria mutado, ai ja no global para todos e tals ele falaria normal
porque se usar este mute em ot de poketibia o player não será capaz de usar as spells dos pokemons, pois para usa-las usa "m1,m2,m3 etc.."
se não for muito incomodo ;D vlw (y)
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

se eu não me engano teria que mudar nas source
em player.cpp procure:
bool Player::isMuted(uint16_t channelId, SpeakClasses type, uint32_t& time)
{
time = 0;
if(hasFlag(PlayerFlag_CannotBeMuted))
return false;
int32_t muteTicks = 0;
for(ConditionList::iterator it = conditions.begin(); it != conditions.end(); ++it)
{
if((*it)->getType() == CONDITION_MUTED && (*it)->getSubId() == 0 && (*it)->getTicks() > muteTicks)
muteTicks = (*it)->getTicks();
}
time = (uint32_t)muteTicks / 1000;
return time > 0 && type != SPEAK_PRIVATE_PN && (type != SPEAK_CHANNEL_Y || (channelId != CHANNEL_GUILD && !g_chat.isPrivateChannel(channelId)));
}
e troque por
bool Player::isMuted(uint16_t channelId, SpeakClasses type, uint32_t& time)
{
time = 0;
if(hasFlag(PlayerFlag_CannotBeMuted))
return false;
int32_t muteTicks = 0;
for(ConditionList::iterator it = conditions.begin(); it != conditions.end(); ++it)
{
if((*it)->getType() == CONDITION_MUTED && (*it)->getSubId() == 0 && (*it)->getTicks() > muteTicks)
muteTicks = (*it)->getTicks();
}
time = (uint32_t)muteTicks / 1000;
return time > 0 && type != SPEAK_PRIVATE_PN && (type != SPEAK_CHANNEL_Y || (channelId != CHANNEL_GUILD && channelId != CHANNEL_DEFAULT && !g_chat.isPrivateChannel(channelId)));
}
obs: não tenho certeza se vai funcionar
caso não funcione, desta maneira tenho ctz que vai:
bool Player::isMuted(uint16_t channelId, SpeakClasses type, uint32_t& time)
{
time = 0;
if(hasFlag(PlayerFlag_CannotBeMuted))
return false;
int32_t muteTicks = 0;
for(ConditionList::iterator it = conditions.begin(); it != conditions.end(); ++it)
{
if((*it)->getType() == CONDITION_MUTED && (*it)->getSubId() == 0 && (*it)->getTicks() > muteTicks)
muteTicks = (*it)->getTicks();
}
time = (uint32_t)muteTicks / 1000;
return time > 0 && type != SPEAK_PRIVATE_PN && (type != SPEAK_CHANNEL_Y || (channelId != CHANNEL_DEFAULT && !g_chat.isPrivateChannel(channelId)));
}
info
Grupo: Campones
Registrado: 18/08/12
Posts: 17
Reputação: 0
Char no Tibia: Delaks

Bom script , tava precisando,abraço
info
Grupo: Banidos
Registrado: 30/07/12
Posts: 279
Reputação: +16
Char no Tibia: Raidou

Muito Bom,este script.
Funciona em 8.54 neh?
Abraços.
info
Grupo: Conde
Registrado: 18/07/08
Posts: 545
Reputação: +21
Char no Tibia: Nem eu sei

se eu não me engano teria que mudar nas source
em player.cpp procure:
bool Player::isMuted(uint16_t channelId, SpeakClasses type, uint32_t& time) { time = 0; if(hasFlag(PlayerFlag_CannotBeMuted)) return false; int32_t muteTicks = 0; for(ConditionList::iterator it = conditions.begin(); it != conditions.end(); ++it) { if((*it)->getType() == CONDITION_MUTED && (*it)->getSubId() == 0 && (*it)->getTicks() > muteTicks) muteTicks = (*it)->getTicks(); } time = (uint32_t)muteTicks / 1000; return time > 0 && type != SPEAK_PRIVATE_PN && (type != SPEAK_CHANNEL_Y || (channelId != CHANNEL_GUILD && !g_chat.isPrivateChannel(channelId))); }e troque por
bool Player::isMuted(uint16_t channelId, SpeakClasses type, uint32_t& time) { time = 0; if(hasFlag(PlayerFlag_CannotBeMuted)) return false; int32_t muteTicks = 0; for(ConditionList::iterator it = conditions.begin(); it != conditions.end(); ++it) { if((*it)->getType() == CONDITION_MUTED && (*it)->getSubId() == 0 && (*it)->getTicks() > muteTicks) muteTicks = (*it)->getTicks(); } time = (uint32_t)muteTicks / 1000; return time > 0 && type != SPEAK_PRIVATE_PN && (type != SPEAK_CHANNEL_Y || (channelId != CHANNEL_GUILD && channelId != CHANNEL_DEFAULT && !g_chat.isPrivateChannel(channelId))); }obs: não tenho certeza se vai funcionar
caso não funcione, desta maneira tenho ctz que vai:
bool Player::isMuted(uint16_t channelId, SpeakClasses type, uint32_t& time) { time = 0; if(hasFlag(PlayerFlag_CannotBeMuted)) return false; int32_t muteTicks = 0; for(ConditionList::iterator it = conditions.begin(); it != conditions.end(); ++it) { if((*it)->getType() == CONDITION_MUTED && (*it)->getSubId() == 0 && (*it)->getTicks() > muteTicks) muteTicks = (*it)->getTicks(); } time = (uint32_t)muteTicks / 1000; return time > 0 && type != SPEAK_PRIVATE_PN && (type != SPEAK_CHANNEL_Y || (channelId != CHANNEL_DEFAULT && !g_chat.isPrivateChannel(channelId))); }
tentei compilar dessas duas maneiras diferentes, e ao usar o /mute o jogador foi mutado em TODOS channels, e tambem no DEFAULT, fazendo o player morrer por nao usar magias..
criei um topico com a dúvida, se puder ajudar
http://www.xtibia.com/forum/topic/235781-mute-apenas-no-help/
Editado Julho 26 por roriscrave
info
Grupo: Campones
Registrado: 01/12/16
Posts: 50
Reputação: +36
Gênero: Masculino

só tem 1 problema na script kkkk
você muta o player, se ele relogar o muted sai '-'
info
Grupo: Campones
Registrado: 14/10/15
Posts: 42
Reputação: +14

Em 26/01/2017 at 14:24, RobsonSilva disse:só tem 1 problema na script kkkk
você muta o player, se ele relogar o muted sai '-'
só no teu mundo né? é pq n existe um onLOgin de certo para dar os minutos que falta
info
Grupo: Banidos
Registrado: 25/07/12
Posts: 94
Reputação: +5
Char no Tibia: SevenSiin
Este Script Muta o player no default,ou no help?