Jump to content

guisetvisible + bindKey


CheiN

Recommended Posts

client:

function showPanel () 
guiSetVisible (Ventanachorete, true) 
showCursor (true) 
end 
addEvent( "showPanel", true ) 
addEventHandler ( "showPanel", getRootElement(), showPanel) 
  

server:

addEventHandler("onPlayerJoin",root, 
function () 
    bindKey(source,"l","down",show) 
end) 
  
addEventHandler("onResourceStart",resourceRoot, 
function () 
    for index, player in ipairs(getElementsByType("player")) do 
        bindKey(player,"l","down",show) 
    end 
end) 
  
function show(thePlayer) 
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup("Console")) then 
  
        triggerClientEvent(thePlayer,"showPanel",thePlayer) 
    end 
end 
  

creo que eso sirve

Link to comment

El no pidio que sea server side, ni que verificara si esta en el ACL de "Console".

@Mr.Domo:

bindKey ( "L", "down", 
    function ( ) 
        guiSetVisible ( miVentana, not guiGetVisible ( miVentana ) ) -- Muestra la ventana o la oculta si ya estaba visible. 
        showCursor ( guiGetVisible ( miVentana ) ) -- Muestra el cursor segun la ventana este visible o no. 
    end 
) 

Link to comment
  • Recently Browsing   0 members

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