Ir para conteúdo

Gustavots

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Obrigado
    Gustavots recebeu reputação de Odranoel S.S em [Talkaction] Ban por Comando   
    Mais organizado e com um salve de registro em logs:
     
     
    function onSay(cid, words, param, channel) local t = string.explode(param, ",") if #t < 3 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite /ban nome, dias, motivo.") return true end local name, days, motivo = t[1], tonumber(t[2]), t[3] local acc = getAccountIdByName(name) if acc ~= 0 then local tempo = days * 24 * 3600 local target = getCreatureByName(name) if target then doAddAccountBanishment(acc, target, os.time() + tempo, 5, 2, "Você foi banido por " .. motivo .. ", por " .. tempo .. " segundos.", 0) doBroadcastMessage("O jogador " .. getCreatureName(target) .. " foi banido por " .. getCreatureName(cid) .. ". Motivo: " .. motivo .. ".", 25) addEvent(doRemoveCreature, 3 * 1000, target, true) -- Registro no arquivo de log local bansFile = "data/logs/bans.txt" local playerName = getCreatureName(cid) local currentTime = os.date("%Y-%m-%d %H:%M:%S") local file = io.open(bansFile, "a") if file then file:write(currentTime .. " - " .. playerName .. " baniu " .. name .. " por " .. days .. " dias. Motivo: " .. motivo .. "\n") file:close() else print("Erro ao abrir o arquivo de log de bans.") end return true else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Jogador não encontrado.") return true end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Jogador não encontrado.") return true end end  
     
    Creditos: Odranoel
  2. Obrigado
    Gustavots recebeu reputação de Odranoel S.S em Global Effect   
    --[[> ODRANOEL S.S <]]-- function onSay(cid, words, param, channel) local params = string.explode(param, " ") if #params < 2 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Use o comando da seguinte forma: !efeito 1, Sua Mensagem") return true end local effect = tonumber(params[1]) local message = table.concat(params, " ", 2) for _, pid in ipairs(getPlayersOnline()) do addEvent(sendEffectToPlayer, math.random(0, 200), pid, effect, message) end return true end function sendEffectToPlayer(pid, effect, message) if isPlayer(pid) then local position = getCreaturePosition(pid) for i = 1, 30 do doSendDistanceShoot(position, {x = position.x + math.random(-7, 7), y = position.y + math.random(-5, 5), z = position.z}, effect) end doCreatureSay(pid, message, TALKTYPE_ORANGE_1) end end  

Informação Importante

Confirmação de Termo