Plate Posted July 6, 2012 Share Posted July 6, 2012 Hola me podrian decir si esto esta bien? porfavor client : local lvl = tiggerServerEvent("Lvl",getLocalPlayer()) addEventHandler("onClientRender",root, function() dxDrawText(""..lvl.."",636.0,148.0,696.0,183.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawRectangle(633.0,142.0,67.0,46.0,tocolor(255,255,255,255),false) end ) Server: addEvent("Lvl",true) addEventHandler("Lvl",getRootElement(), function (thePlayer) exports.exp_system:getPlayerLevel ( thePlayer ) end) Link to comment
Castillo Posted July 6, 2012 Share Posted July 6, 2012 Esta mal, triggerServerEvent no devuelve el resultado, solo ejecuta el evento. addEventHandler("onClientRender",root, function() dxDrawText( tostring ( getElementData ( localPlayer, "level" ) ),636.0,148.0,696.0,183.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawRectangle(633.0,142.0,67.0,46.0,tocolor(255,255,255,255),false) end ) Link to comment
Plate Posted July 6, 2012 Author Share Posted July 6, 2012 no se ve solid u.u que tengo que hacer para que se vea? Link to comment
Castillo Posted July 6, 2012 Share Posted July 6, 2012 Deberia funcionar, estas usando la ultima version de "exp_system"? Link to comment
Plate Posted July 6, 2012 Author Share Posted July 6, 2012 si la que vos me dijistes no se ve nada inicio el recurso y se ve comun la pantalla ( no aparece el cuadrado con el level) Link to comment
Arsilex Posted July 6, 2012 Share Posted July 6, 2012 Prueba asi addEventHandler("onClientRender",root, function() dxDrawText( tostring ( getElementData ( localPlayer, "lvl" ) ),636.0,148.0,696.0,183.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawRectangle(633.0,142.0,67.0,46.0,tocolor(255,255,255,255),false) end ) Link to comment
Castillo Posted July 6, 2012 Share Posted July 6, 2012 si la que vos me dijistes no se ve nada inicio el recurso y se ve comun la pantalla ( no aparece el cuadrado con el level) Entonces quiere decir que no esta funcionando el script, hay algun error? @pekio: El "exp_system" lo cree yo, se que dataNames use y es "level", no "lvl". Link to comment
Plate Posted July 6, 2012 Author Share Posted July 6, 2012 sigo sin poder ver el cuadradito con el level yo pienso que es el dxDrawText no el script cuando lo inicio no me da ningun error puede ser que necesite descargar la ultima version de guieditor Link to comment
Castillo Posted July 6, 2012 Share Posted July 6, 2012 Acabo de probar tu codigo, y lo unico que hace es crear un rectangulo blanco en la pantalla, te aconsejo crearlo de nuevo con guieditor. Link to comment
Plate Posted July 6, 2012 Author Share Posted July 6, 2012 use la ultima version de guieditor que vi y lo hize haci pero me da error addEventHandler("onClientRender",root, function() dxDrawText("tostring ( getElementData ( localPlayer, "level" "),628.0,141.0,674.0,177.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawRectangle(625.0,135.0,53.0,48.0,tocolor(255,255,255,255),false) end ) Link to comment
Castillo Posted July 6, 2012 Share Posted July 6, 2012 Quita las comillas de aca ( no las de "level" ): "tostring ( getElementData ( localPlayer, "level" " Link to comment
Plate Posted July 6, 2012 Author Share Posted July 6, 2012 Solid creo que es el dxDrawRectangle lo que hace el cuadrado blanco Link to comment
Castillo Posted July 6, 2012 Share Posted July 6, 2012 addEventHandler("onClientRender",root, function ( ) dxDrawRectangle(625.0,135.0,53.0,48.0,tocolor(0,0,255,155),false) dxDrawText( tostring ( getElementData ( localPlayer, "level" ),628.0,141.0,674.0,177.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) end ) Link to comment
Castillo Posted July 6, 2012 Share Posted July 6, 2012 tostring ( getElementData ( localPlayer, "level" ))), Tiene un parentesis de mas. Link to comment
Plate Posted July 6, 2012 Author Share Posted July 6, 2012 Me funciono de 10 gracias solid solo le agregue un ) y listo Link to comment
Plate Posted July 6, 2012 Author Share Posted July 6, 2012 Solid y hay que esta mal -- Direct X Drawing addEventHandler("onClientRender",root, function() dxDrawRectangle(620.0,134.0,113.0,46.0,tocolor(0,0,255,255),false) dxDrawText( tostring ( getElementData ( localPlayer, "level" )",680.0,156.0,742.0,167.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("exp",685.0,136.0,739.0,147.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("tostring ( getElementData ( localPlayer, "exp" )",628.0,153.0,641.0,168.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("Level",626.0,136.0,681.0,151.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) end ) Link to comment
Plate Posted July 6, 2012 Author Share Posted July 6, 2012 pero me dice level/main_c.lua ")"expected near "default" Link to comment
Castillo Posted July 6, 2012 Share Posted July 6, 2012 -- Direct X Drawing addEventHandler("onClientRender",root, function() dxDrawRectangle(620.0,134.0,113.0,46.0,tocolor(0,0,255,255),false) dxDrawText( tostring ( getElementData ( localPlayer, "level" ) ),680.0,156.0,742.0,167.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("exp",685.0,136.0,739.0,147.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText(tostring ( getElementData ( localPlayer, "exp" ) ),628.0,153.0,641.0,168.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) dxDrawText("Level",626.0,136.0,681.0,151.0,tocolor(255,255,255,255),1.0,"default","left","top",false,false,false) end ) Tenias que poner otro parentesis. Link to comment
Plate Posted July 6, 2012 Author Share Posted July 6, 2012 Solid se podria hacer para que se vea la exp que te falta para subir de level? Link to comment
Castillo Posted July 6, 2012 Share Posted July 6, 2012 Eso ya es otra cosa, ya que mi recurso no lo guarda como element data, lo calcula en el momento. Link to comment
Plate Posted July 6, 2012 Author Share Posted July 6, 2012 Seria algo mas complicado osea que tendria que poner que tome la exp de un xml y despues lo ponga en un dxDrawText no? Link to comment
Recommended Posts