sQuirreL6 Posted July 9, 2013 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.
1B0Y Posted July 10, 2013 Posted July 10, 2013 make sure the font is being downloaded before you create the font. fileExists sometimes helps. Founder of Kutmode - http://kutmode.com | https://discord.gg/P3FXVnF (Retired) Leading Developer of Grand Theft International (Retired) Leading Developer of Full Theft Auto. (Retired) Owner of SourceMod.
myonlake Posted July 10, 2013 Posted July 10, 2013 Make sure you put that thing in the "onClientResourceStart" event so that it will be properly set. If I helped you, please click the like button on the right Thanks!
sQuirreL6 Posted July 10, 2013 Author 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...
Castillo Posted July 10, 2013 Posted July 10, 2013 And when are you using the guiSetFont? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
sQuirreL6 Posted July 10, 2013 Author 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 )
Castillo Posted July 10, 2013 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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted July 10, 2013 Posted July 10, 2013 Maybe your font is corrupted. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
sQuirreL6 Posted July 10, 2013 Author Posted July 10, 2013 It's not, sometimes work, sometimes doesn't, I replaced font, with other one and it's not working...
sQuirreL6 Posted July 10, 2013 Author 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 -.-
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