Jump to content

Meu codico não oculta hud, radar, joinquit etc...


Recommended Posts

local screen = {guiGetScreenSize()} local x, y = (screen[1]/1366), (screen[2]/768) local font = dxCreateFont('files/font.ttf', x*15, false)

pos = {
    {x * 428, y * 264, x * 509, y * 50, y * 273, y * 264, y * 314},
    {x * 428, y * 324, x * 509, y * 50, y * 333, y * 324, y * 374},
    {x * 428, y * 384, x * 509, y * 50, y * 393, y * 384, y * 434},
    {x * 428, y * 444, x * 509, y * 50, y * 453, y * 444, y * 494},
}

proximaPagina = 0
maxLinhas = 4

itens = {
    {'Hud', true, getTickCount(), 'hud'}, 
    {'Ruas', true, getTickCount(), 'ruas'}, 
	{'Radar', true, getTickCount(), 'radar'}, 
    {'Chat Bubble', true, getTickCount(), 'chatbubble'},
    {'Joinquit', true, getTickCount(), 'joinquit'}, 
    {'Chat', true, getTickCount()},
    {'Som Armas', true, getTickCount(), 'sonsarma'}, 
    {'hitmaker/genrl', true, getTickCount(), 'hitmaker'},
}

function drawPainel ()
    local alpha = interpolateBetween(0, 0, 0, 255, 0, 0, ((getTickCount() - tick) / 800), 'Linear')
    dxDrawImage(x * 415, y * 224, x * 545, y * 301, 'files/fundo.png', 0, 0, 0, tocolor(255, 255, 255, alpha), false)
    linha = 0
    for i, v in ipairs(itens) do
        if (i > proximaPagina and linha < maxLinhas) then
            linha = linha + 1
            dxDrawImage(pos[linha][1], pos[linha][2], pos[linha][3], pos[linha][4], 'files/barra.png', 0, 0, 0, tocolor(255, 255, 255, alpha), false)
            if (v[2] == true) then
                local posx = interpolateBetween(854, 0, 0, 886, 0, 0, ((getTickCount() - v[3]) / 300), 'Linear')
                local alpha2 = interpolateBetween(0, 0, 0, 255, 0, 0, ((getTickCount() - v[3]) / 1000), 'Linear')
                dxDrawImage(x * 854, pos[linha][5], x * 64, y * 32, 'files/on.png', 0, 0, 0, tocolor(0, 230, 0, alpha2), false)
                dxDrawImage(x * posx, pos[linha][5], x * 64, y * 32, 'files/circle.png', 0, 0, 0, tocolor(255, 255, 255, alpha2), false)
            else
                local posx = interpolateBetween(886, 0, 0, 854, 0, 0, ((getTickCount() - v[3]) / 300), 'Linear')
                local alpha2 = interpolateBetween(0, 0, 0, 255, 0, 0, ((getTickCount() - v[3]) / 100), 'Linear')
                local alpha3 = interpolateBetween(255, 0, 0, 0, 0, 0, ((getTickCount() - v[3]) / 100), 'Linear')
                dxDrawImage(x * 854, pos[linha][5], x * 64, y * 32, 'files/on.png', 0, 0, 0, tocolor(0, 230, 0, alpha3), false)
                dxDrawImage(x * posx, pos[linha][5], x * 64, y * 32, 'files/circle.png', 0, 0, 0, tocolor(255, 255, 255, alpha2), false)
                dxDrawImage(x * 854, pos[linha][5], x * 64, y * 32, 'files/off.png', 0, 0, 0, tocolor(255, 255, 255, alpha2), false)
            end
            dxDrawText(v[1], x * 454, pos[linha][6], x * 752, pos[linha][7], tocolor(255, 255, 255, alpha), 1.00, font, 'left', 'center', false, false, false, false, false)
        end
    end
end

addEventHandler('onClientClick', root,
    function (button, state)
        if (button == 'left') and (state == 'down') then
            if isEventHandlerAdded('onClientRender', root, drawPainel) then
                if isMouseInPosition(x * 938, y * 234, x * 19, y * 20) then
                    showCursor(false)
                    removeEventHandler('onClientRender', root, drawPainel)
                else
                    linha = 0
                    for i, v in ipairs(itens) do
                        if (i > proximaPagina and linha < maxLinhas) then
                            linha = linha + 1
                            if isMouseInPosition(x * 854, pos[linha][5], x * 64, y * 32) then
                                v[2] = not v[2]
                                v[3] = getTickCount()
                                --if (v[1] == 'Radar') then
                                  --  setPlayerHudComponentVisible('radar', v[2])
                                if (v[1] == 'Chat') then
                                    showChat(v[2])
                                else
                                    exports[v[4]]:loadMod(v[2])
                                end
                                playSound("files/hover.ogg", false)
                               -- playSoundFrontEnd(1)
                            end
                        end
                    end
                end
            end
        end
    end
)

function UpDown (b)
    if isEventHandlerAdded('onClientRender', root, drawPainel) then
        if isMouseInPosition(x * 415, y * 224, x * 545, y * 301) then
            if b == 'mouse_wheel_down' then
                proximaPagina = proximaPagina + 1
                if (proximaPagina > #itens - maxLinhas) then
                    proximaPagina = #itens - maxLinhas
                end
            elseif b == 'mouse_wheel_up'  then
                if (proximaPagina > 0) then
                    proximaPagina = proximaPagina - 1
                end
            end
        end
    end
end
bindKey('mouse_wheel_up', 'down', UpDown)
bindKey('mouse_wheel_down', 'down', UpDown)

bindKey('F3', 'down',
    function ()
        if not isEventHandlerAdded('onClientRender', root, drawPainel) then
            playSound("files/sound.ogg", false)
            tick = getTickCount()
            showCursor(true)
            addEventHandler('onClientRender', root, drawPainel)
        else
            playSound("files/sound.ogg", false)
            showCursor(false)
            removeEventHandler('onClientRender', root, drawPainel)
        end
    end
)

function isMouseInPosition(x,y,w,h)
	if isCursorShowing() then
		local sx,sy = guiGetScreenSize()
		local cx,cy = getCursorPosition()
		local cx,cy = (cx*sx),(cy*sy)
		if (cx >= x and cx <= x+w) and (cy >= y and cy <= y+h) then
			return true
		end
	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

 

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...