• Couldn't include file 'darkrp\gamemode\cl_init.lua' (File not found)
    4 replies, posted
I get this error every time i attempt to start the game with DarkRP as the gamemode: [CODE]TrinityX|3|-steamidsnip- Couldn't include file 'realrp\gamemode\cl_init.lua' (File not found) (<nowhere>) TrinityX|3|-steamidsnip- Couldn't Load Init Script: 'realrp/gamemode/cl_init.lua'[/CODE] I have some custom coding, but when i launch the same gamemode in singleplayer, it works. The joining player will get "Too many LUA errors! Sorry!" I have also noticed many other people getting the same error, maybe it's just a Garry's Mod bug? [B]EDIT:[/B] Yes, cl_init.lua exists and is included and added clientside properly.
This is because you have an error in your cl_init.lua and it cant be loaded because the script is being terminated before it loads. Check for errors.
It's because you don't load your gamemode through the startup line: +gamemode MyGamemode
[QUOTE=ms333;40110311]It's because you don't load your gamemode through the startup line: +gamemode MyGamemode[/QUOTE] Wrong. Just straight up wrong. Not only is this not the issue, but you don't have to use the command line. You can use the server.cfg, you can type gamemode (GAMEMODENAME) in console and switch maps, or you could put the gamemode parameter into the autoexec.cfg
I start the gamemode in singleplayer fine with no errors at all, however, when i start in in a revision 159 dedicated server with +gamemode DarkRP and "gamemode" "DarkRP" in server.cfg I desperately need help with this, so here's the cl_init.lua [lua] GM.Version = "2.4.3" GM.Name = "DarkRP" GM.Author = "By Rickster, Updated: Pcwizdan, Sibre, philxyz, [GNC] Matt, Chrome Bolt, FPtje Falco, Eusion, Drakehawke" DeriveGamemode("sandbox") util.PrecacheSound("earthquake.mp3") CUR = "$" /*--------------------------------------------------------------------------- Fonts ---------------------------------------------------------------------------*/ surface.CreateFont ("DarkRPHUD1", { size = 16, weight = 600, antialias = true, shadow = true, font = "DejaVu Sans"}) surface.CreateFont ("DarkRPHUD2", { size = 23, weight = 400, antialias = true, shadow = false, font = "coolvetica"}) /*--------------------------------------------------------------------------- Names ---------------------------------------------------------------------------*/ -- Make sure the client sees the RP name where they expect to see the name local pmeta = FindMetaTable("Player") pmeta.SteamName = pmeta.SteamName or pmeta.Name function pmeta:Name() if not self or not self.IsValid or not IsValid(self) then return "" end self.DarkRPVars = self.DarkRPVars or {} if not GAMEMODE.Config.allowrpnames then return self:SteamName() end return self.DarkRPVars.rpname and tostring(self.DarkRPVars.rpname) or self:SteamName() end pmeta.GetName = pmeta.Name pmeta.Nick = pmeta.Name -- End function GM:DrawDeathNotice(x, y) if not GAMEMODE.Config.showdeaths then return end self.BaseClass:DrawDeathNotice(x, y) end local function DisplayNotify(msg) local txt = msg:ReadString() GAMEMODE:AddNotify(txt, msg:ReadShort(), msg:ReadLong()) surface.PlaySound("buttons/lightswitch2.wav") -- Log to client console print(txt) end usermessage.Hook("_Notify", DisplayNotify) local function LoadModules() local root = GM.FolderName.."/gamemode/modules/" local _, folders = file.Find(root.."*", "LUA") for _, folder in SortedPairs(folders, true) do for _, File in SortedPairs(file.Find(root .. folder .."/cl_*.lua", "LUA"), true) do include(root.. folder .. "/" ..File) end for _, File in SortedPairs(file.Find(root .. folder .."/sh_*.lua", "LUA"), true) do include(root.. folder .. "/" ..File) end end end LocalPlayer().DarkRPVars = LocalPlayer().DarkRPVars or {} for k,v in pairs(player.GetAll()) do v.DarkRPVars = v.DarkRPVars or {} end GM.Config = {} -- config table include("config.lua") include("client/help.lua") include("client/DRPDermaSkin.lua") include("client/helpvgui.lua") include("client/hud.lua") include("client/showteamtabs.lua") include("client/vgui.lua") include("shared/animations.lua") include("shared/commands.lua") include("shared/entity.lua") include("shared/language.lua") include("shared/MakeThings.lua") include("shared/Workarounds.lua") include("shared.lua") include("addentities.lua") include("ammotypes.lua") include("fpp/sh_settings.lua") include("fpp/client/FPP_Menu.lua") include("fpp/client/FPP_HUD.lua") include("fpp/client/FPP_Buddies.lua") include("fpp/sh_CPPI.lua") LoadModules() surface.CreateFont("AckBarWriting", { size = 20, weight = 500, antialias = true, shadow = false, font = "akbar"}) -- Copy from FESP(made by FPtje Falco) -- This is no stealing since I made FESP myself. local vector = FindMetaTable("Vector") function vector:RPIsInSight(v, ply) ply = ply or LocalPlayer() local trace = {} trace.start = ply:EyePos() trace.endpos = self trace.filter = v trace.mask = -1 local TheTrace = util.TraceLine(trace) if TheTrace.Hit then return false, TheTrace.HitPos else return true, TheTrace.HitPos end end function GM:HUDShouldDraw(name) if name == "CHudHealth" or name == "CHudBattery" or name == "CHudSuitPower" or name == "CHudAmmo" or (HelpToggled and name == "CHudChat") then return false else return true end end function GM:HUDDrawTargetID() return false end function GM:FindPlayer(info) if not info or info == "" then return nil end local pls = player.GetAll() for k = 1, #pls do -- Proven to be faster than pairs loop. local v = pls[k] if tonumber(info) == v:UserID() then return v end if info == v:SteamID() then return v end if string.find(string.lower(v:SteamName()), string.lower(tostring(info)), 1, true) ~= nil then return v end if string.find(string.lower(v:Name()), string.lower(tostring(info)), 1, true) ~= nil then return v end end return nil end local GUIToggled = false local HelpToggled = false local HelpVGUI local function ToggleHelp() if not HelpVGUI then HelpVGUI = vgui.Create("HelpVGUI") end HelpToggled = not HelpToggled HelpVGUI.HelpX = HelpVGUI.StartHelpX HelpVGUI:FillHelpInfo() HelpVGUI:SetVisible(HelpToggled) gui.EnableScreenClicker(HelpToggled) end usermessage.Hook("ToggleHelp", ToggleHelp) local function ToggleClicker() GUIToggled = not GUIToggled gui.EnableScreenClicker(GUIToggled) end usermessage.Hook("ToggleClicker", ToggleClicker) local function DoSpecialEffects(Type) local thetype = string.lower(Type:ReadString()) local toggle = tobool(Type:ReadString()) if toggle then if thetype == "motionblur" then hook.Add("RenderScreenspaceEffects", thetype, function() DrawMotionBlur(0.05, 1.00, 0.035) end) elseif thetype == "dof" then DOF_SPACING = 8 DOF_OFFSET = 9 DOF_Start() elseif thetype == "colormod" then hook.Add("RenderScreenspaceEffects", thetype, function() local settings = {} settings[ "$pp_colour_addr" ] = 0 settings[ "$pp_colour_addg" ] = 0 settings[ "$pp_colour_addb" ] = 0 settings[ "$pp_colour_brightness" ] = -1 settings[ "$pp_colour_contrast" ] = 0 settings[ "$pp_colour_colour" ] =0 settings[ "$pp_colour_mulr" ] = 0 settings[ "$pp_colour_mulg" ] = 0 settings[ "$pp_colour_mulb" ] = 0 DrawColorModify(settings) end) elseif thetype == "drugged" then hook.Add("RenderScreenspaceEffects", thetype, function() DrawSharpen(-1, 2) DrawMaterialOverlay("models/props_lab/Tank_Glass001", 0) DrawMotionBlur(0.13, 1, 0.00) end) elseif thetype == "deathpov" then hook.Add("CalcView", "rp_deathPOV", function(ply, origin, angles, fov) local Ragdoll = ply:GetRagdollEntity() if not IsValid(Ragdoll) then return end local head = Ragdoll:LookupAttachment("eyes") head = Ragdoll:GetAttachment(head) if not head or not head.Pos then return end local view = {} view.origin = head.Pos view.angles = head.Ang view.fov = fov return view end) end elseif toggle == false then if thetype == "dof" then DOF_Kill() return elseif thetype == "deathpov" then if hook.GetTable().CalcView and hook.GetTable().CalcView.rp_deathPOV then hook.Remove("CalcView", "rp_deathPOV") end return end hook.Remove("RenderScreenspaceEffects", thetype) end end usermessage.Hook("DarkRPEffects", DoSpecialEffects) local Messagemode = false local playercolors = {} local HearMode = "talk" local isSpeaking = false local GroupChat = false local function RPStopMessageMode() Messagemode = false hook.Remove("Think", "RPGetRecipients") hook.Remove("HUDPaint", "RPinstructionsOnSayColors") playercolors = {} end local function CL_IsInRoom(listener) -- IsInRoom function to see if the player is in the same room. local tracedata = {} tracedata.start = LocalPlayer():GetShootPos() tracedata.endpos = listener:GetShootPos() local trace = util.TraceLine( tracedata ) return not trace.HitWorld end local PlayerColorsOn = CreateClientConVar("rp_showchatcolors", 1, true, false) local function RPSelectwhohearit(group) if PlayerColorsOn:GetInt() == 0 then return end Messagemode = true GroupChat = group hook.Add("HUDPaint", "RP
Sorry, you need to Log In to post a reply to this thread.