ODutii Posted August 10, 2019 Posted August 10, 2019 Estou criando uma hud, e não acho a variavel para mostrar o fps, podem me mandar um script? dxDrawText(mostrarfpsaqui, 1122, 188, 1228, 205, tocolor(255, 255, 255, 255), 1.40, "default-bold", "left", "top", false, false, false, false, false)
DNL291 Posted August 10, 2019 Posted August 10, 2019 https://wiki.multitheftauto.com/wiki/GetCurrentFPS Tá aí, só copiar o código da função no seu script e usar a função dentro do dxDrawText. Please do not PM me with scripting related question nor support, use the forums instead.
ODutii Posted August 10, 2019 Author Posted August 10, 2019 (edited) local function drawFPS() if not getCurrentFPS() then return dxDrawText(dxDrawText(roundedFPS, sx - dxGetTextWidth(roundedFPS), 1122, 188, 1228, 205, tocolor(255, 255, 255, 255), 1.40, "default-bold", "left", "top", false, false, false, false, false) local roundedFPS = math.floor(getCurrentFPS()) end O End não está funcionando, e seu retirar o end, ele vai pegar os dxDraw abaixo desse, na verdade, nem se eu retirar o end nada abaixo disso vai funcionar, ele buga a patir do local roundedFPS Edited August 10, 2019 by ODutii
DNL291 Posted August 10, 2019 Posted August 10, 2019 local fps = false 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) addEventHandler( "onClientRender", root, function() dxDrawText( "FPS: ".. (fps or "N/A"), 1122, 188, 1228, 205, tocolor(255, 255, 255, 255), 1.40, "default-bold", "left", "top", false, false, false, false, false) end ) Please do not PM me with scripting related question nor support, use the forums instead.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now