• Question about G.Include/G.AddCSLuaFile
    3 replies, posted
Do all includes have to be in cl_init.lua and init.lua? I tried putting them in other files but they don't work; I get this error: [lua] Couldn't include file 'sh_bxma.lua' (File not found) (@gamemodes/tttest/gamemode/sv_bxma.lua (line 2)) [AddCSLuaFile] Couldn't find 'cl_bxma.lua' (@gamemodes/tttest/gamemode/sv_bxma.lua (line 3)) Couldn't include file 'sv_bxma.lua' (File not found) (@gamemodes/tttest/gamemode/sv_bxma.lua (line 4)) [/lua]
-snip- what was I doing
Curious. Can you use BroadcastLua("include(\"cl_file.lua\")") to include client files that don't need to be ran before initialize?
[QUOTE=Sudoxe192;40814363]Depends what type of file you are including. For client files: [code] // Place in a server side file i.e. init.lua AddCSLuaFile("file path") // Place in a client side file i.e. cl_init.lua include("same file path") [/code] For serverside files [code] // Place in a server side file i.e. init.lua AddCSLuaFile("file path here") include("file path here") [/code] To sum up, to include client side files you need to do it both serverside and client side. Including server side files, you just need to do it server side.[/QUOTE] I have included a server lua file in init.lua. From that server file I want to include another server file, and add a client-side file. All the files shown in the error are in the same directory as the server file/init file, yet errors are shown. Note: The client-side file is included in cl_init.lua
Sorry, you need to Log In to post a reply to this thread.