Jump to content

Panel


Arsilex

Recommended Posts

Por que no me funciona esto

local state = false 
--Interfraz 
function Panel ( ) 
    dxDrawRectangle(1229.0,1.0,137.0,766.0,tocolor(0,0,0,160),false) 
    dxDrawImage(1232.0,120.0,134.0,119.0,"Imagenes/Stats.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) 
    dxDrawImage(1232.0,401.0,134.0,119.0,"Imagenes/Stats.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) 
    dxDrawImage(1232.0,261.0,134.0,119.0,"Imagenes/Maps.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) 
end 
  
function Panel2 () 
    Player = guiCreateButton(1237,134,124,105,"",false) 
    guiSetAlpha(Player,0.5) 
    Mapas = guiCreateButton(1237,275,124,105,"",false) 
    guiSetAlpha(Mapas,1) 
    AntiLag = guiCreateButton(1237,408,124,105,"",false) 
    guiSetAlpha(AntiLag,1) 
    addEventHandler ( "onClientGuiClick", Player, Stats1, false ) 
end 
addEvent ( "onPanel2", true ) 
addEventHandler ( "onPanel2", root, Panel2 ) 
  
function Panelq2 () 
destroyElement (Player) 
destroyElement (Mapas) 
destroyElement (AntiLag) 
end 
addEvent ( "onPanelq2", true ) 
addEventHandler ( "onPanelq2", root, Panelq2 ) 
  
  
function Stats1() 
    addEventHandler ( "onClientRender", root, stats ) 
end 
  
  
bindKey ( "F7", "down", 
    function ( ) 
        state = ( not state ) 
        removeEventHandler ( "onClientRender", root, Panel ) 
        triggerEvent ( "onPanelq2", root) 
        showCursor ( false ) 
        if ( state ) then 
            addEventHandler ( "onClientRender", root, Panel ) 
            triggerEvent ( "onPanel2", root) 
            showCursor ( true ) 
        end 
    end 
) 

Link to comment

MarcosR tu piensas antes de ablar que funciones???? Si esta todo

Enciende el panel

bindKey ( "F7", "down", 
    function ( ) 
        state = ( not state ) 
        removeEventHandler ( "onClientRender", root, Panel ) 
        triggerEvent ( "onPanelq2", root) 
        showCursor ( false ) 
        if ( state ) then 
            addEventHandler ( "onClientRender", root, Panel ) 
            triggerEvent ( "onPanel2", root) 
            showCursor ( true ) 
        end 
    end 
) 

    addEventHandler ( "onClientGuiClick", Player, Stats1, false ) 

Eso cuando presiono el boton Player tiene que encenderse Stats1 Osea esto

function Stats1() 
    addEventHandler ( "onClientRender", root, stats ) 
end 

Que activa lo que tengo en stats ....

Link to comment

Mira tengo otra duda

tengo esto en serverside

function showHome() 
    local Home = exports.admin:getPlayerCountry(source) or "N/A" 
    setElementData(source,"Country",Home) 
end 
addEventHandler("onResourceStart", root, showHome) 
  

y esto en ClientSide

        Country = getElementData(source,"Country") 
        dxDrawColorText( tostring ( Country ),355.0,108.0,471.0,126.0,tocolor(255,255,255,255),1.0,"sans","left","top",false,false,true) 
  

pero me sale false :S

Link to comment
  • Recently Browsing   0 members

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