local screen = {guiGetScreenSize()} local x, y = (screen[1]/1366), (screen[2]/768) function progress () local y = y - 0.15 dxDrawRectangle(x * 591, y * 666, x * 184, y * 35, tocolor(0, 0, 0, 155), false) dxDrawRectangle(x * 591, y * 666, x * 184 / 100 * amount, y * 35, tocolor(0, 171, 254, 255), false) dxDrawLine(x * 591 - 1, y * 666 - 1, x * 591 - 1, y * 701, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(x * 775, y * 666 - 1, x * 591 - 1, y * 666 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(x * 591 - 1, y * 701, x * 775, y * 701, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(x * 775, y * 701, x * 775, y * 666 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawText(math.floor(amount)..'%', x * 590, y * 665, x * 775, y * 701, tocolor(255, 255, 255, 255), 1.00, getFont('medium', 12), 'center', 'center', false, false, false, false, false) local pos2 = {getElementPosition(localPlayer)} if (amount >= 100) or getDistanceBetweenPoints3D(pos2[1], pos2[2], pos2[3], pos[1], pos[2], pos[3]) > 4 then removeEventHandler('onClientRender', root, progress) end end addEvent('Caio.onProgressMiner', true) addEventHandler('Caio.onProgressMiner', root, function (action, value, position) if action == 'add' then amount = value pos = position if not isEventHandlerAdded('onClientRender', root, progress) then addEventHandler('onClientRender', root, progress) end else end end) function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end function getFont(name, size) if not name then return end if not size then return end return exports['mtrp_assets']:loadFont(name, size) end local txd = engineLoadTXD("files/pickaxe.txd") if txd then engineImportTXD(txd, 322) -- Primeiro importa a textura else outputDebugString("Falha ao carregar TXD") end local dff = engineLoadDFF("files/pickaxe.dff", 322) if dff then engineReplaceModel(dff, 322) -- Depois substitui o modelo else outputDebugString("Falha ao carregar DFF") end