Client won't download "client addon scripts" from custom gamemode?
2 replies, posted
I have been trying to get this thing working for more hours than I care to admit, and I have no idea why it refuses to function. Here is the scenario:
I wrote a custom moderation tool for my server. It is actually really simple, primarily to help me understand lua/addons.
So I test out the addon using a garrysmod multiplayer server. It works fine for me. (presumably because it is in my addons folder).
Next I [I]uninstall[/I] the custom addon from my personal computer and slap it onto a dedicated server I have.
Whenever I try to join said dedicated server, my client doesn't appear to download the [I]client lua scripts[/I] contained in my addon.
Here is a bit of code.
[B]lua/autorun/rem.lua[/B]
[lua]
// Client scripts
Msg("Loading REM Module...\n")
if CLIENT then
AddCSLuaFile("rem_client.lua")
include("rem_client.lua")
end
[/lua]
[B]lua/rem_client.lua[/B]
[lua]
initialized = false
/* Some logic here */
Msg("Loading Client Module...\n")
function REM_InitializeAll()
if ( false ) then return end
REM_Init_Shared()
concommand.Add("+REM_Menu", REM_ShowMenu)
concommand.Add("-REM_Menu", REM_HideMenu)
initialized = true
end
concommand.Add("REM_CS_Initialize", REM_InitializeAll)
RPLAYER = nil
Msg("Client Module Loaded!\n")
[/lua]
As far as I know, there is absolutely no reason the client script shouldn't be loading. Am I missing something?
Any help is greatly GREATLY appreciated, thanks for taking a look!
-SharpCoder
Try:
And instead of .cs name the file .lua
[lua]
Msg("Loading REM Module...\n")
if SERVER then
AddCSLuaFile("rem_client.lua")
end
include("rem_client.lua")
[/lua]
[QUOTE=Freze;34741148]Try:
And instead of .cs name the file .lua
[lua]
Msg("Loading REM Module...\n")
if SERVER then
AddCSLuaFile("rem_client.lua")
end
include("rem_client.lua")
[/lua][/QUOTE]
Thanks for the suggestion! I have no idea what I was thinking when I wrote this post, but it looks like my file is actually [I].lua[/I]. Good catch though! I will fix my original post...
[I]Edit[/I]
Also I tried your code suggestion and it still seems like the client won't load the script. I wonder if there is a server variable that I have switched off which prevents the client from downloading?
Sorry, you need to Log In to post a reply to this thread.