Arsilex Posted September 14, 2012 Share Posted September 14, 2012 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
BorderLine Posted September 14, 2012 Share Posted September 14, 2012 que es lo que presisamente no funciona?. deberias intentar haciendo el bind en serverside y aplicando los triggers Link to comment
Arsilex Posted September 14, 2012 Author Share Posted September 14, 2012 no no es que cuando presiona en el boton Player no se abre el menu Link to comment
DefearT Posted September 14, 2012 Share Posted September 14, 2012 Para que puedas abir el panel, tienes que ponerle las funciones al boton para que se pueda abrir, si no le pones el nombre de la funcion al boton como piensas que se abrira. Link to comment
Arsilex Posted September 14, 2012 Author Share Posted September 14, 2012 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
Castillo Posted September 14, 2012 Share Posted September 14, 2012 Es: "onClientGUIClick", no "onClientGuiClick". Pusiste con minusculas: "ui". Link to comment
Arsilex Posted September 14, 2012 Author Share Posted September 14, 2012 ammm ok voy a probarlo gracias xDDD Link to comment
Arsilex Posted September 14, 2012 Author Share Posted September 14, 2012 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 Link to comment
Castillo Posted September 14, 2012 Share Posted September 14, 2012 Eso es porque estas usando el evento: "onResourceStart" que no tiene ningun argumento de jugador. Link to comment
Arsilex Posted September 14, 2012 Author Share Posted September 14, 2012 use onPlayerJoin y tambien sale lo mismo ._. Link to comment
Castillo Posted September 14, 2012 Share Posted September 14, 2012 Pero vas a tener que poner el pais tambien cuando inicia el recurso para todos los jugadores, porque si no tendran que reconectar. Link to comment
Arsilex Posted September 14, 2012 Author Share Posted September 14, 2012 como que poner el pais? supuestamente no se extarae el pais del admin? Link to comment
Castillo Posted September 14, 2012 Share Posted September 14, 2012 A eso me refiero, pero tambien cuando el recurso inicia. Link to comment
Arsilex Posted September 14, 2012 Author Share Posted September 14, 2012 no entiendo y como tengo que hacer eso o que tengo que usar Link to comment
Recommended Posts