IsDir changes?

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?




	if !file.IsDir("logs") then
		file.CreateDir("logs");



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


surface.CreateFont("Playername", {size = 19, weight = 500, antialias = true, shadow = false, font = "Verdana"})

Then when loading into the font using


lblName:SetFont( "Playername" )

It errors out the setfont, i also tried using


self.lblName:SetFont("Playername")

But again setfont errored.

[lua]file.IsDir( “helloworld.txt”, “DATA” ) [/lua]

And: http://wiki.garrysmod.com/page/Libraries/surface/SetFont

Thank you, ill try it out :slight_smile:

[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.



// Day logs
	**if !file.IsDir("logs/" .. Year) then**
		file.CreateDir("logs/" .. Year);
	end


I was gonna use, but still errors. Whats wrong?


	
// Day logs
	**if !file.IsDir("logs/" .. Year .. , "DATA" ) then**
		file.CreateDir("logs/" .. Year);
	end


[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]

Description: 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.