• IsDir changes?
    7 replies, posted
Hello there, I'm currently working on a logging system for my server, and in old gmod, the way to check and create directories was like this? [CODE] if !file.IsDir("logs") then file.CreateDir("logs"); [/CODE] But funny enough, it returns a bad argument, IsDir strong expected, no value. Error. Have this changed in anyway? Another error would be in my attempt of creating a scoreboard and using custom fonts. I used the new form for creating fonts [CODE]surface.CreateFont("Playername", {size = 19, weight = 500, antialias = true, shadow = false, font = "Verdana"})[/CODE] Then when loading into the font using [CODE]lblName:SetFont( "Playername" )[/CODE] It errors out the setfont, i also tried using [CODE]self.lblName:SetFont("Playername")[/CODE] But again setfont errored.
[lua]file.IsDir( "helloworld.txt", "DATA" ) [/lua] [url]http://wiki.garrysmod.com/page/Libraries/file/IsDir[/url] And: [url]http://wiki.garrysmod.com/page/Libraries/surface/SetFont[/url]
Thank you, ill try it out :) [editline]7th January 2013[/editline] One more thing, because the surface.setfont("fontname") is pretty much overall, how would i make it so that i can set the hostname font like. self.Hostname:SetFont("Hostnamefont") = gmod 10 way, how to do this in gmod 13 style? [editline]7th January 2013[/editline] Anyone?
This one line errors. [CODE] // Day logs [B]if !file.IsDir("logs/" .. Year) then[/B] file.CreateDir("logs/" .. Year); end [/CODE] I was gonna use, but still errors. Whats wrong? [CODE] // Day logs [B]if !file.IsDir("logs/" .. Year .. , "DATA" ) then[/B] file.CreateDir("logs/" .. Year); end [/CODE]
[lua] if !file.IsDir("logs/" .. Year, "DATA" ) then[/lua] If 'Year' is something like "2013.txt"
I made the isdir work now, i just need to know how to label the fonts so i can use different sizes etc in the scoreboard itself. As described above.
Since it seems like you didn't read the links I give you, here's an example from the wiki: [lua] surface.SetTextPos( 128, 128 ) surface.SetFont( "Default" ) surface.DrawText( "Hello Fonts" ) [/lua] [b]Description:[/b] Draws 'Hello Fonts' on the screen, with the 'Default' font.
I did, but using the surface.Setfont("default") in a file, makes that the font for every thing in that file, I'm trying to label it so i can use different fonts for playername, hostname and ping, kills etc. like on old gmod, it was self.label:Setfont("fontname") but i cant find anything on that for gmod 13.
Sorry, you need to Log In to post a reply to this thread.