Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado
  • Autor
  Em 01/06/2017 em 00:28, Thiago Virtuoso disse:

local config = {
    useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')),
}

function onSay(cid, words, param, channel)
    if(not config.useFragHandler) then
        return false
    end
    local time = os.time()
    local times = {today = (time - 86400), week = (time - (7 * 86400))}
    local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
    if(result:getID() ~= -1) then
        repeat
            local content = {
                name = result:getDataString("name"),
                level = result:getDataInt("level"),
                date = result:getDataInt("date")
            }
            if(content.date > times.today) then
                table.insert(contents.day, content)
            elseif(content.date > times.week) then
                table.insert(contents.week, content)
            else
                table.insert(contents.month, content)
            end
        until not result:next()
        result:free()
    end
    local size = {
        day = table.maxn(contents.day),
        week = table.maxn(contents.week),
        month = table.maxn(contents.month)
    }

    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.")
    if(size.day > 0) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")
    end
    local skullEnd = getPlayerSkullEnd(cid)
    if(skullEnd > 0) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))
    end
    return true
end

testa assim, não testei aqui

Foi... 21:29 You currently have 0 frags today, 0 this week and 0 this month. valeu :D acredito é por conta ser otx a script muda né? kk pq quando era tfs a script era normal

  • Respostas 10
  • Visualizações 559
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Thiago Virtuoso
    Thiago Virtuoso

    local config = { useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')), advancedFragList = getBooleanFromString(getConfigValue('advancedFragList')) } function onSay(cid, word

  • Thiago Virtuoso
    Thiago Virtuoso

    local config = { useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')), } function onSay(cid, words, param, channel) if(not config.useFragHandler) then return false

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.7k

Informação Importante

Confirmação de Termo