Sign in to follow this  
#Horus

ME AJUDEM ? É RAPIDO, BATE E VOLTA

Recommended Posts

Boa tarde, alguem sabe o nome desse mod? usam ele em todos os servidores praticamente.

LINK DA IMAGEM DELE ABAIXO:

https://imgur.com/a/fXq0oRK

 

Share this post


Link to post
10 minutes ago, #Horus said:

Boa tarde, alguem sabe o nome desse mod? usam ele em todos os servidores praticamente.

LINK DA IMAGEM DELE ABAIXO:

https://imgur.com/a/fXq0oRK

 

Não consegui acessar o link da imagem, poste neste site:

prnt.sc

Share this post


Link to post

Opa, fiz aqui pra você (: 

 

client-side:

local screenW,screenH = guiGetScreenSize()
local resW, resH = 1366,768
local x, y = (screenW/resW), (screenH/resH)

serverName = "Nome do Servidor"

addEventHandler("onClientRender", root,
function()
	local time = getRealTime()
	local day = time.monthday
	local month = time.month
	local year = time.year + 1900

	dxDrawText(serverName.."\1-\1FPS: "..getElementData(getLocalPlayer(), "fps").."\n"..day.."/"..month.."/"..year.."\1-\1"..getTimeS(), x*1190, y*723, x*1360, y*757, tocolor(255, 254, 254, 150), x*1.00, "clear", "right", "center", false, false, false, true, false)
end
)

function  getTimeS() 
    local time = getRealTime() 
    local hours = time.hour 
    local minutes = time.minute 
    local seconds = time.second 
    if (hours >= 0 and hours < 10) then 
        hours = "0"..time.hour 
    end 
    if (minutes >= 0 and minutes < 10) then 
        minutes = "0"..time.minute 
    end 
    if (seconds >= 0 and seconds < 10) then 
        seconds = "0"..time.second 
    end 
    return hours..":"..minutes..":"..seconds 
end 

local fps = false

function getCurrentFPS() -- Setup the useful function
    return fps
end

local function updateFPS(msSinceLastFrame)
    -- FPS are the frames per second, so count the frames rendered per milisecond using frame delta time and then convert that to frames per second.
    fps = (1 / msSinceLastFrame) * 1000
end
addEventHandler("onClientPreRender", root, updateFPS)

local function getAverageFPSOfFPSArray(table)
    -- Average FPS = (FPS1 + FPS2 + ... + FPSX) / X
    local totalFPS = 0
    for _, fps in pairs(table) do
        totalFPS = totalFPS + fps
    end
    return totalFPS / #table
end

local currentSecondFPS = {}
local lastSecondTicks = getTickCount()
local lastFiveSecondsFPS = {}
local function smoothFPS()
    -- Do we have a FPS rate already?
    if not getCurrentFPS() then
        return
    end
    -- Insert current FPS into a table for reference
    table.insert(currentSecondFPS, getCurrentFPS())
    -- If a second passed, get the average FPS using the table
    -- (We always have at least one frame rendered, so dividing by 0 it's not a problem)
    if getTickCount() - lastSecondTicks >= 1000 then
        local averageFPSPerSecond = getAverageFPSOfFPSArray(currentSecondFPS)
        -- Reset variables
        currentSecondFPS = {}
        lastSecondTicks = getTickCount()
        -- Update the table containing last five seconds FPS
        -- Also update the FPS limit accordingly
        table.insert(lastFiveSecondsFPS, averageFPSPerSecond)
        -- Silently discard too old average FPS
        if #lastFiveSecondsFPS == 6 then
            table.remove(lastFiveSecondsFPS, 1)
        end
        -- Get the average FPS of the average FPS of each of the last five seconds, and use the result as the frame limit
		setElementData(localPlayer, "fps", (math.ceil(getAverageFPSOfFPSArray(lastFiveSecondsFPS)))); -- Sets elementData "fps"
    end
end
addEventHandler("onClientHUDRender", root, smoothFPS)

 

Share this post


Link to post
18 hours ago, Tommy. said:

Opa, fiz aqui pra você 🙂

 

client-side:


local screenW,screenH = guiGetScreenSize()
local resW, resH = 1366,768
local x, y = (screenW/resW), (screenH/resH)

serverName = "Nome do Servidor"

addEventHandler("onClientRender", root,
function()
	local time = getRealTime()
	local day = time.monthday
	local month = time.month
	local year = time.year + 1900

	dxDrawText(serverName.."\1-\1FPS: "..getElementData(getLocalPlayer(), "fps").."\n"..day.."/"..month.."/"..year.."\1-\1"..getTimeS(), x*1190, y*723, x*1360, y*757, tocolor(255, 254, 254, 150), x*1.00, "clear", "right", "center", false, false, false, true, false)
end
)

function  getTimeS() 
    local time = getRealTime() 
    local hours = time.hour 
    local minutes = time.minute 
    local seconds = time.second 
    if (hours >= 0 and hours < 10) then 
        hours = "0"..time.hour 
    end 
    if (minutes >= 0 and minutes < 10) then 
        minutes = "0"..time.minute 
    end 
    if (seconds >= 0 and seconds < 10) then 
        seconds = "0"..time.second 
    end 
    return hours..":"..minutes..":"..seconds 
end 

local fps = false

function getCurrentFPS() -- Setup the useful function
    return fps
end

local function updateFPS(msSinceLastFrame)
    -- FPS are the frames per second, so count the frames rendered per milisecond using frame delta time and then convert that to frames per second.
    fps = (1 / msSinceLastFrame) * 1000
end
addEventHandler("onClientPreRender", root, updateFPS)

local function getAverageFPSOfFPSArray(table)
    -- Average FPS = (FPS1 + FPS2 + ... + FPSX) / X
    local totalFPS = 0
    for _, fps in pairs(table) do
        totalFPS = totalFPS + fps
    end
    return totalFPS / #table
end

local currentSecondFPS = {}
local lastSecondTicks = getTickCount()
local lastFiveSecondsFPS = {}
local function smoothFPS()
    -- Do we have a FPS rate already?
    if not getCurrentFPS() then
        return
    end
    -- Insert current FPS into a table for reference
    table.insert(currentSecondFPS, getCurrentFPS())
    -- If a second passed, get the average FPS using the table
    -- (We always have at least one frame rendered, so dividing by 0 it's not a problem)
    if getTickCount() - lastSecondTicks >= 1000 then
        local averageFPSPerSecond = getAverageFPSOfFPSArray(currentSecondFPS)
        -- Reset variables
        currentSecondFPS = {}
        lastSecondTicks = getTickCount()
        -- Update the table containing last five seconds FPS
        -- Also update the FPS limit accordingly
        table.insert(lastFiveSecondsFPS, averageFPSPerSecond)
        -- Silently discard too old average FPS
        if #lastFiveSecondsFPS == 6 then
            table.remove(lastFiveSecondsFPS, 1)
        end
        -- Get the average FPS of the average FPS of each of the last five seconds, and use the result as the frame limit
		setElementData(localPlayer, "fps", (math.ceil(getAverageFPSOfFPSArray(lastFiveSecondsFPS)))); -- Sets elementData "fps"
    end
end
addEventHandler("onClientHUDRender", root, smoothFPS)

 

Obrigado amigo

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.