Ir para conteúdo

Featured Replies

Postado

Boa tarde, eu tenho esse script de mute no meu servidor, ele muta o jogador normalmente pelo tempo que eu escolher, mas se o player relogar o mute sai, alguém saberia arrumar:

local GMGroup = 3 -- grupo mínimo do GM
local maxTimeMute = 60         --Tempo máximo de mute, em minutos. Sim, isso é necessário.
local conditions = {}
for i = 1, maxTimeMute do
    conditions[i] = createConditionObject(CONDITION_MUTED)
    setConditionParam(conditions[i], CONDITION_PARAM_TICKS, i * 60 * 1000)
end
function onSay(cid,words,param)
    local testeGroup = getPlayerGroupId(cid)
    if testeGroup >= GMGroup then
        if param ~= "" then       
            local sep = param:explode(",") 
            local playerMuted, timeMuted = getPlayerByName(sep[1]), tonumber(sep[2])
            if not timeMuted or not conditions[timeMuted] then
                doPlayerSendCancel(cid, "Escolha um tempo de mute (em minutos) válido.")
            elseif isPlayer(playerMuted) then
                local GMName = getPlayerName(cid)
                local playerName = getPlayerName(playerMuted)
                if playerName == GMName then
                    doPlayerSendTextMessage(cid,MESSAGE_STATUS_DEFAULT ,"Por que ao invés aplicar um muted em si mesmo você mesmo não cale a boca?")
                    return 0
                end
                local playerGroup = getPlayerGroupId(playerMuted)
                if playerGroup >= testeGroup then
                    doPlayerSendTextMessage(cid,MESSAGE_STATUS_DEFAULT ,"Você não pode calar um jogador que tenha um cargo maior ou igual ao seu.")
                    return 0
                end
                doAddCondition(playerMuted, conditions[timeMuted])
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_DEFAULT ,"Você aplicou um muted de "..timeMuted.." minuto(s) no jogador "..playerName..".")
                doPlayerSendTextMessage(playerMuted,MESSAGE_STATUS_DEFAULT,"Você foi mutado por "..timeMuted.." minuto(s) pelo "..GMName..".")
            else
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_DEFAULT ,"O nome "..param.." está escrito errado ou este está offline.")
            end        
        end
    end
    return true
end
Postado

  • Script: Comando Mute (Atualisado).
  • Função: Deixar o "Player" Mudo Pelo Tempo Que Desejar.
  • Testado: Versão 8.5

Vá Em "Talkactions > Script" Crie Um Arquivo.lua Nomado Como "muteplayer" e Adicione Dentro Dele:

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

Depois Vá Em "Talkactions.xml" e Adicione:

<talkaction log="yes" words="/mute;/desmute" access="2" event="script" value="muteplayer.lua"/>
  • Comandos:

Citar

  Citar

/mute Nome Do Usuario, Minutos

/desmute Nome Do Usuario

Vá Em " Creaturescript > Script " Crie Um Arquivo.lua Nomado Como "mute_check" e Adicione Dentro Dele:

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

Depois Vá Em " Creaturescript.xml " e Adicione:

<event type="login" name="MutePlayer" event="script" value="mute_check.lua"/>

ESPERO QUE FUNCIONE

Editado por Jair Kevick (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo