I had included the files and it worked now i'm getting the errors again without changing anything. I get these errors:
[CODE][[M] FallenMoons|2|STEAM_0:0:40367380] Lua Error:
Couldn't include file 'sh_init.lua' (File not found) (@gamemodes/metrorp/gamemode/cl_init.lua (line 9))
[[M] FallenMoons|2|STEAM_0:0:40367380] Lua Error:
Couldn't include file 'sh_config.lua' (File not found) (@gamemodes/metrorp/gamemode/cl_init.lua (line 10))
[[M] FallenMoons|2|STEAM_0:0:40367380] Lua Error:
Couldn't include file 'scoreboard\scoreboard.lua' (File not found) (@gamemodes/metrorp/gamemode/cl_init.lua (line 11))
[[M] FallenMoons|2|STEAM_0:0:40367380] Lua Error:
Couldn't include file 'cl_scoreboard.lua' (File not found) (@gamemodes/metrorp/gamemode/cl_init.lua (line 13))
[[M] FallenMoons|2|STEAM_0:0:40367380] Lua Error:
[ERROR] gamemodes/metrorp/gamemode/cl_init.lua:964: attempt to index field 'Config' (a nil value)
1. unknown - gamemodes/metrorp/gamemode/cl_init.lua:964[/CODE]
This is my code for including them. This is cl_init.lua I have also done the same things in the other files. If you need them to help just say so I'm not sure what to actually include here.
[CODE]
include("sh_init.lua")
include("sh_config.lua")
include("scoreboard/scoreboard.lua");
include("cl_scoreboard.lua")
[/CODE]
[QUOTE=FallenMoons;43396180]I had included the files and it worked now i'm getting the errors again without changing anything. I get these errors:
[CODE][[M] FallenMoons|2|STEAM_0:0:40367380] Lua Error:
Couldn't include file 'sh_init.lua' (File not found) (@gamemodes/metrorp/gamemode/cl_init.lua (line 9))
[[M] FallenMoons|2|STEAM_0:0:40367380] Lua Error:
Couldn't include file 'sh_config.lua' (File not found) (@gamemodes/metrorp/gamemode/cl_init.lua (line 10))
[[M] FallenMoons|2|STEAM_0:0:40367380] Lua Error:
Couldn't include file 'scoreboard\scoreboard.lua' (File not found) (@gamemodes/metrorp/gamemode/cl_init.lua (line 11))
[[M] FallenMoons|2|STEAM_0:0:40367380] Lua Error:
Couldn't include file 'cl_scoreboard.lua' (File not found) (@gamemodes/metrorp/gamemode/cl_init.lua (line 13))
[[M] FallenMoons|2|STEAM_0:0:40367380] Lua Error:
[ERROR] gamemodes/metrorp/gamemode/cl_init.lua:964: attempt to index field 'Config' (a nil value)
1. unknown - gamemodes/metrorp/gamemode/cl_init.lua:964[/CODE]
This is my code for including them. This is cl_init.lua I have also done the same things in the other files. If you need them to help just say so I'm not sure what to actually include here.
[CODE]
include("sh_init.lua")
include("sh_config.lua")
include("scoreboard/scoreboard.lua");
include("cl_scoreboard.lua")
[/CODE][/QUOTE]
Did you AddCSLuaFile() them serverside?
remove the "metrorp/gamemode/" part of your calls to include and AddCSLuaFile
Removed all of the "metrorp/gamemode" things, problem still persists.
[QUOTE=FallenMoons;43397052]Removed all of the "metrorp/gamemode" things, problem still persists.[/QUOTE]
What's your file structure?
garrysmod/gamemodes/MetroRP/gamemode/(This is where the lua files and libraries etc are located.)
Don't keep the / at the beginning as you said you did.
He said remove "x/y/" you responded with: Removed "x/y"
Here's how to set up the first 3 files: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/loading_files_across_realms.lua[/url]
I was getting errors for every cl_init inclue I had.
Never found anything by searching but accidentally happened across the culprit.
sv_allowcslua 1
Unless allowcslua is enabled on the server all includes in cl_init fail actling like they can't see the file.
I'm assuming it's either a bug or a feature.
So far my workaround has been to just throw everything into cl_init and worry about it later, like my countries economy.
[QUOTE=Handsome Matt;43402819]No, no no no.. NO. This is NOT a fix, you're just forgetting to AddCSLuaFile your clientside files.[/QUOTE]
Oh really? So is include only for server files or is it an additional call?
[B]Edit:[/B]
Ohhhhh. I see. Included on server to say which client side includes are allowed by name.
Thanks. I got it now.
I think you would faint if you saw my code right now, but at least it has nice comments like
[CODE]-- I can't be bothered to figure this out, so heres a hack solution. this should really be inside cl_friendlyname.lua but whatever.[/CODE]
[QUOTE=Willox;43396887]remove the "metrorp/gamemode/" part of your calls to include and AddCSLuaFile[/QUOTE]
Since they're shared files anyway it's better practice to just put AddCSLuaFile with no arguments in the files (uses current file), that way if they are removed because they become deprecated you don't have to go into another file and remove the AddCSLuaFile lines there.
This is what I changed them to:
[CODE]
include("sh_init.lua")
include("sh_config.lua")
include("scoreboard/scoreboard.lua");
include("cl_scoreboard.lua")[/CODE]
Yet the problem still persists.
Sorry, you need to Log In to post a reply to this thread.