Ir para conteúdo
Propaganda

Posts Recomendados

 

 

 

EU QUERO QUE MUTA QUANDO PLAYER RELOGA ELE CONTINUA MUTADO E NAO TA DANDO SÓ DA QUANDO ELE TA ONLINE QUANDO ELE DESLOGA E LOGA SAI MUTED.

local GMGroup = 6 -- grupo mínimo do GM
local maxTimeMute = 60 * 24 * 360        --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])
setPlayerStorageValue(cid, 91828, os.time() + timeMuted * 60)
                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
Link para o comentário
https://tibiadevs.com/forums/topic/1344-tfs-036-860-mute-system/
Compartilhar em outros sites

Crie uma conta ou entre para comentar

Você precisar ser um membro para fazer um comentário

Criar uma conta

Crie uma nova conta em nossa comunidade. É fácil!

Crie uma nova conta

Entrar

Já tem uma conta? Faça o login.

Entrar Agora
×
  • Criar Novo...