Evil-Cod3r Posted February 29, 2012 Share Posted February 29, 2012 Hi all i made this but the font not work ! addEvent("Enter",true) addEventHandler("Enter",getRootElement(), function(name) if isElement(jon) and isElement(p_name) then restTimer(pn) restTimer(jn) guiSetText(p_name,tostring(name)) else jon = guiCreateLabel(14,197,38,14," Joined: ",false) p_name = guiCreateLabel(59, 198, 227, 17,tostring(name),false) pn = setTimer(destroyElement,22000,1,p_name) jn = setTimer(destroyElement,22000,1,jon) end end) function start () myFont = guiCreateFont( "font/20.ttf", 12 ) guiSetFont( jon, myFont ) else destroyElement( myFont ) myFont = nil end end end addEventHandler("onClientResourceStart",getRootElement(), start ) Link to comment
Castillo Posted February 29, 2012 Share Posted February 29, 2012 addEventHandler("onClientResourceStart",resourceRoot, function () myFont = guiCreateFont( "font/20.ttf", 12 ) end ) addEvent("Enter",true) addEventHandler("Enter",getRootElement(), function(name) if isElement(jon) and isElement(p_name) then restTimer(pn) restTimer(jn) guiSetText(p_name,tostring(name)) else jon = guiCreateLabel(14,197,38,14," Joined: ",false) guiSetFont( jon, myFont ) p_name = guiCreateLabel(59, 198, 227, 17,tostring(name),false) pn = setTimer(destroyElement,22000,1,p_name) jn = setTimer(destroyElement,22000,1,jon) end end ) Link to comment
Kenix Posted February 29, 2012 Share Posted February 29, 2012 Again syntax error Evil-Cod3r,Learn lua! viewtopic.php?f=91&t=40809 And this: https://wiki.multitheftauto.com/wiki/Scr ... troduction viewtopic.php?f=91&t=40807 Please! Link to comment
Evil-Cod3r Posted February 29, 2012 Author Share Posted February 29, 2012 i dont think guiCreateFont work for mta 1.3 i fixed it another way thanks all Link to comment
Castillo Posted February 29, 2012 Share Posted February 29, 2012 Maybe the font is wrong? or too big? Link to comment
Evil-Cod3r Posted February 29, 2012 Author Share Posted February 29, 2012 SoldSnake can i make some Anminon for the Text ?? like flashing for 8 sec and the destroy ? Link to comment
Kenix Posted February 29, 2012 Share Posted February 29, 2012 viewtopic.php?f=108&t=24262&hilit=textlib Download http://www.mediafire.com/?o3ndd7jtf8gqf54 Link to comment
Evil-Cod3r Posted February 29, 2012 Author Share Posted February 29, 2012 and how to use it Kenix ? but it in meta with my script ? Link to comment
Kenix Posted February 29, 2012 Share Posted February 29, 2012 (edited) So, you need add this files to meta.xml Simple script: local text,anim local function Remove ( ) text:color( 0, 0, 0, 0 ) text:destroy() text = nil anim:remove() anim = nil end addCommandHandler( 'simple', function( ) if text then Remove( ) end text = dxText:create( "Text", 650.0, 91.0, false, 'default', 2, 'center' ) text:align("center", "center") text:type( 'stroke' ) text:color( 255,0,0,255 ) anim = Animation.createAndPlay( text, Animation.presets.dxTextFadeOut( 5000 ), Remove ) end ) type /simple and this text shows only 5 sec and destroy. Edited February 29, 2012 by Guest Link to comment
Evil-Cod3r Posted February 29, 2012 Author Share Posted February 29, 2012 i think i start learn first becuse its hard thing Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now