larissaots 163 Postado Maio 30, 2015 Share Postado Maio 30, 2015 Créditos à principe sharigan. Objetivo Mutar e desmutar o player usando /mute ou /desmute. Tutorial talkactions.xml: <talkaction log="yes" acess="3" words="/mute;/desmute" access="2" event="script" value="muteplayer.lua"/> talkactions/scripts, crie arquivo com nome muteplayer.lua e bote isso dentro: 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 Link para o comentário Compartilhar em outros sites More sharing options...
Vodkart 1513 Postado Junho 3, 2015 Share Postado Junho 3, 2015 não vai funcionar, falta o onLogin para checar a condition... falando nisso os créditos não são dele, são de outra pessoa, até porque essa mesma talk já existe no fórum. Link para o comentário Compartilhar em outros sites More sharing options...
Deadpool 862 Postado Janeiro 26, 2017 Share Postado Janeiro 26, 2017 Caro membro, seu tópico foi movido de Scripts > Otserv > Actions, talkactions e moveevents para Soluções > Recepção Xtibia > Lixeira Pública. Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados