Jump to content

Key binding


alexd4040

Recommended Posts

create a function like that:

function toggleGuixd () 
    if YOURGUIVARIABLE and guiGetVisible ( YOURGUIVARIABLE ) then 
        guiSetVisible ( YOURGUIVARIABLE, false ) 
        showCursor ( false ) 
    else 
        lazpuer() -- performs the function that creates the gui 
        showCursor ( true ) 
    end 
end 
bindKey( "l", "down", toggleGuixd ) 
  
-- Or: 
  
function toggleGuixd2 () 
    guiSetVisible ( YOURGUIVARIABLE, not guiGetVisible ( YOURGUIVARIABLE ) ) 
    showCursor ( not isCursorShowing() ) 
end 
bindKey( "l", "down", toggleGuixd2 ) 

Change YOURGUIVARIABLE and lazpuer() (if necessary)

Link to comment

I got this:

function lazpuer() 
    occup = getPedOccupiedVehicle( localPlayer ) 
    if occup then 
        local screenW, screenH = guiGetScreenSize() 
        ventana = guiCreateWindow((screenW - 430) / 2, (screenH - 286) / 2, 430, 286, "Control Vehicular", false) 
        guiWindowSetSizable(ventana, false) 
  
        huud1 = guiCreateScrollBar(104, 27, 316, 24, true, false, ventana) 
        doorleft = guiCreateScrollBar(104, 61, 316, 24, true, false, ventana) 
        doorright = guiCreateScrollBar(104, 95, 316, 24, true, false, ventana) 
        doorleft2 = guiCreateScrollBar(104, 129, 316, 24, true, false, ventana) 
        doorright2 = guiCreateScrollBar(104, 163, 316, 24, true, false, ventana) 
        trunks = guiCreateScrollBar(104, 197, 316, 24, true, false, ventana) 
        cerrars = guiCreateButton(9, 227, 411, 49, "Cerrar", false, ventana) 
        guiSetProperty(cerrars, "NormalTextColour", "FFAAAAAA") 
        huudtext = guiCreateLabel(11, 27, 93, 24, "Capo", false, ventana) 
        guiLabelSetHorizontalAlign(huudtext, "center", false) 
        doorlefttext = guiCreateLabel(11, 61, 93, 24, "Puerta 1", false, ventana) 
        guiLabelSetHorizontalAlign(doorlefttext, "center", false) 
        doorrighttext = guiCreateLabel(11, 95, 93, 24, "Puerta 2", false, ventana) 
        guiLabelSetHorizontalAlign(doorrighttext, "center", false) 
        doorleft2text = guiCreateLabel(11, 129, 93, 24, "Puerta 3", false, ventana) 
        guiLabelSetHorizontalAlign(doorleft2text, "center", false) 
        doorright2txt = guiCreateLabel(11, 163, 93, 24, "Puerta 4", false, ventana) 
        guiLabelSetHorizontalAlign(doorright2txt, "center", false) 
        trunkstext = guiCreateLabel(11, 197, 93, 24, "Maletero", false, ventana) 
        guiLabelSetHorizontalAlign(trunkstext, "center", false)    
     
        showCursor (true) 
        addEventHandler ("onClientGUIScroll", huud1, huudfunc, false) 
        addEventHandler ("onClientGUIScroll", doorleft, dlfunc, false) 
        addEventHandler ("onClientGUIScroll", doorright, drfunc, false) 
        addEventHandler ("onClientGUIScroll", doorleft2, dl2func, false) 
        addEventHandler ("onClientGUIScroll", doorright2, dr2func, false) 
        addEventHandler ("onClientGUIScroll", trunks, trunksfunc, false) 
        addEventHandler ("onClientGUIClick", cerrars, cerrarfunc, false) 
    else 
        exports.TopBarChat:sendClientMessage( "Tienes que estar en un auto para modificar las puertas!", 255, 30, 0 ) 
    end 
end 
bindKey("l", "down", lazpuer) 
  
 function cerrarfunc() 
    showCursor( false ) 
    guiSetVisible( ventana, not guiGetVisible( ventana ) ) 
end 
  

Link to comment
local screenW, screenH = guiGetScreenSize() 
  
function lazpuer() 
        ventana = guiCreateWindow((screenW - 430) / 2, (screenH - 286) / 2, 430, 286, "Control Vehicular", false) 
        guiWindowSetSizable(ventana, false) 
        guiSetVisible(ventana, false) 
  
        huud1 = guiCreateScrollBar(104, 27, 316, 24, true, false, ventana) 
        doorleft = guiCreateScrollBar(104, 61, 316, 24, true, false, ventana) 
        doorright = guiCreateScrollBar(104, 95, 316, 24, true, false, ventana) 
        doorleft2 = guiCreateScrollBar(104, 129, 316, 24, true, false, ventana) 
        doorright2 = guiCreateScrollBar(104, 163, 316, 24, true, false, ventana) 
        trunks = guiCreateScrollBar(104, 197, 316, 24, true, false, ventana) 
        cerrars = guiCreateButton(9, 227, 411, 49, "Cerrar", false, ventana) 
        guiSetProperty(cerrars, "NormalTextColour", "FFAAAAAA") 
        huudtext = guiCreateLabel(11, 27, 93, 24, "Capo", false, ventana) 
        guiLabelSetHorizontalAlign(huudtext, "center", false) 
        doorlefttext = guiCreateLabel(11, 61, 93, 24, "Puerta 1", false, ventana) 
        guiLabelSetHorizontalAlign(doorlefttext, "center", false) 
        doorrighttext = guiCreateLabel(11, 95, 93, 24, "Puerta 2", false, ventana) 
        guiLabelSetHorizontalAlign(doorrighttext, "center", false) 
        doorleft2text = guiCreateLabel(11, 129, 93, 24, "Puerta 3", false, ventana) 
        guiLabelSetHorizontalAlign(doorleft2text, "center", false) 
        doorright2txt = guiCreateLabel(11, 163, 93, 24, "Puerta 4", false, ventana) 
        guiLabelSetHorizontalAlign(doorright2txt, "center", false) 
        trunkstext = guiCreateLabel(11, 197, 93, 24, "Maletero", false, ventana) 
        guiLabelSetHorizontalAlign(trunkstext, "center", false)   
    
        addEventHandler ("onClientGUIScroll", huud1, huudfunc, false) 
        addEventHandler ("onClientGUIScroll", doorleft, dlfunc, false) 
        addEventHandler ("onClientGUIScroll", doorright, drfunc, false) 
        addEventHandler ("onClientGUIScroll", doorleft2, dl2func, false) 
        addEventHandler ("onClientGUIScroll", doorright2, dr2func, false) 
        addEventHandler ("onClientGUIScroll", trunks, trunksfunc, false) 
        addEventHandler ("onClientGUIClick", cerrars, cerrarfunc, false) 
end 
addEventHandler("onClientResourceStart", resourceRoot, lazpuer) 
  
bindKey( "l", "down",  
    function() 
        if  getPedOccupiedVehicle( localPlayer ) then 
            guiSetVisible(ventana, not guiGetVisible(ventana)) 
            showCursor(guiGetVisible(ventana)) 
        else 
            exports.TopBarChat:sendClientMessage( "Tienes que estar en un auto para modificar las puertas!", 255, 30, 0 ) 
        end 
    end 
) 
  
function cerrarfunc() 
    showCursor( false ) 
    guiSetVisible( ventana, not guiGetVisible( ventana ) ) 
end 
  

Try it.

Link to comment

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
  • Recently Browsing   0 members

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