sQuirreL6 Posted July 9, 2013 Share Posted July 9, 2013 cs_regular = guiCreateFont("cs_regular.ttf", 15) Why sometimes this returns nil? I mean when I restart resource doesn't work, when I restart it again it works. Link to comment
1B0Y Posted July 10, 2013 Share Posted July 10, 2013 make sure the font is being downloaded before you create the font. fileExists sometimes helps. Link to comment
myonlake Posted July 10, 2013 Share Posted July 10, 2013 Make sure you put that thing in the "onClientResourceStart" event so that it will be properly set. Link to comment
sQuirreL6 Posted July 10, 2013 Author Share Posted July 10, 2013 addEventHandler("onClientResourceStart", resourceRoot, function() cs_regular = guiCreateFont("cs_regular.ttf", 15) cs_regular2 = guiCreateFont("cs_regular.ttf", 15.5) cs_big = guiCreateFont("cs_regular.ttf", 20) end ) This is my code, but still doesn't work... Link to comment
Castillo Posted July 10, 2013 Share Posted July 10, 2013 And when are you using the guiSetFont? Link to comment
sQuirreL6 Posted July 10, 2013 Author Share Posted July 10, 2013 addEventHandler("onClientResourceStart", resourceRoot, function() showCursor(true) guiSetInputEnabled(true) login["Login-Window"] = guiCreateWindow( (screenWidth/2)-150, (screenHeight/2)-117.5, 300, 235,"LOL", false ) --guiSetVisible(login["Login-Window"], false ) guiSetAlpha( login["Login-Window"], 0.50 ) login["Label"] = guiCreateLabel( 20, 20, 260, 15, "Login", false, login["Login-Window"]) guiSetFont(login["Label"], cs_big) end ) Link to comment
Castillo Posted July 10, 2013 Share Posted July 10, 2013 addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) cs_regular = guiCreateFont("cs_regular.ttf", 15) cs_regular2 = guiCreateFont("cs_regular.ttf", 15.5) cs_big = guiCreateFont("cs_regular.ttf", 20) showCursor(true) guiSetInputEnabled(true) login["Login-Window"] = guiCreateWindow( (screenWidth/2)-150, (screenHeight/2)-117.5, 300, 235,"LOL", false ) --guiSetVisible(login["Login-Window"], false ) guiSetAlpha( login["Login-Window"], 0.50 ) login["Label"] = guiCreateLabel( 20, 20, 260, 15, "Login", false, login["Login-Window"]) guiSetFont(login["Label"], cs_big) end ) Try that. Link to comment
Castillo Posted July 10, 2013 Share Posted July 10, 2013 Maybe your font is corrupted. Link to comment
sQuirreL6 Posted July 10, 2013 Author Share Posted July 10, 2013 It's not, sometimes work, sometimes doesn't, I replaced font, with other one and it's not working... Link to comment
sQuirreL6 Posted July 10, 2013 Author Share Posted July 10, 2013 cs_regular = guiCreateFont("cs_regular.ttf", 15) if (not cs_regular) then cs_regular = guiCreateFont("cs_regular.ttf", 15) if (not cs_regular) then cs_regular = guiCreateFont("cs_regular.ttf", 15) if (not cs_regular) then cs_regular = guiCreateFont("cs_regular.ttf", 15) if (not cs_regular) then cs_regular = guiCreateFont("cs_regular.ttf", 15) if (not cs_regular) then cs_regular = guiCreateFont("cs_regular.ttf", 15) if (not cs_regular) then cs_regular = guiCreateFont("cs_regular.ttf", 15) if (not cs_regular) then cs_regular = guiCreateFont("cs_regular.ttf", 15) end end end end end end end It's working rofl -.- 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