• Deathrun with Gmod 14
    5 replies, posted
I tried to install deathrun on my Garry's Mod server. However, when I connect to the server, it says that cl_init is missing. I have not edited the gamemode at all; this is straight from the GitHub repo as of 10 minutes ago. [IMG]http://i.imgur.com/N2U1JoS.png[/IMG] Obviously, the cl_init.lua is there, so there must be something else wrong. Please help!
Is the cl_init.lua empty? And does the gamemode actually work?
[QUOTE=Ducky3426;45759740]Is the cl_init.lua empty? And does the gamemode actually work?[/QUOTE] cl_init.lua is as follows: [CODE]if CLIENT then include( "shared.lua" ) surface.CreateFont( "Deathrun_Smooth", { font = "Trebuchet18", size = 14, weight = 700, antialias = true } ) surface.CreateFont( "Deathrun_SmoothMed", { font = "Trebuchet18", size = 24, weight = 700, antialias = true } ) surface.CreateFont( "Deathrun_SmoothBig", { font = "Trebuchet18", size = 34, weight = 700, antialias = true } ) end include( "cl_scoreboard.lua" ) include( "cl_frames.lua" ) include( "menutext.lua" ) include( "cl_voice.lua" ) include( "rtv/config.lua" ) include( "rtv/cl_rtv.lua" ) if SERVER then return end local name = "Dragon Dildo" language.Add( "trigger_hurt", name ) language.Add( "env_explosion", name ) language.Add( "worldspawn", name ) language.Add( "func_movelinear", name ) language.Add( "func_physbox", name ) language.Add( "func_rotating", name ) language.Add( "func_door", name ) language.Add( "entityflame", name ) language.Add( "prop_physics", name ) function draw.AAText( text, font, x, y, color, align ) draw.SimpleText( text, font, x+1, y+1, Color(0,0,0,math.min(color.a,120)), align ) draw.SimpleText( text, font, x+2, y+2, Color(0,0,0,math.min(color.a,50)), align ) draw.SimpleText( text, font, x, y, color, align ) end local clamp = math.Clamp local hx, hw, hh, border = 5, 204, 30, 2 local keys = {} local draw_keys = false function GM:HUDPaint( ) local ply = LocalPlayer() local ob = ply:GetObserverTarget() if ob and IsValid(ob) and ob:IsPlayer() and ob:Alive() then draw.AAText( ob:Nick(), "Deathrun_SmoothBig", ScrW()/2, 5, Color(255,255,255,255), TEXT_ALIGN_CENTER) ply = ob draw_keys = true else draw_keys = false end if not keys[ply] then keys[ply] = {} end local hy = ScrH() - 35 draw.RoundedBox( 0, hx, hy, hw, hh, Color( 44, 44, 44, 175 ) ) draw.RoundedBox( 0, hx + border, hy + border, hw - border*2, hh - border*2, Color( 180, 80, 80, 255 ) ) local thp = ply:Alive() and ply:Health() or 0 local hp = thp if hp > 0 then hp = ( hw - border*2 ) * ( math.Clamp(ply:Health(),0,100)/100) draw.RoundedBox( 0, hx + border, hy + border, hp, hh - border*2, Color( 80, 180, 60, 255 ) ) end draw.AAText( tostring( thp > 999 and "dafuq" or math.max(thp, 0) ), "Deathrun_SmoothBig", hx + 5, hy - 3, Color(255,255,255,255), TEXT_ALIGN_LEFT ) surface.SetFont( "Deathrun_SmoothBig" ) local rt = string.ToMinutesSeconds(self:GetRoundTime()) local ttw, _ = surface.GetTextSize( rt ) local tw = hw/2 + 5 draw.WordBox( 4, tw - ttw/2, hy - 45, rt, "Deathrun_SmoothBig", Color( 44, 44, 44, 200 ), Color( 255, 255, 255, 255 ) ) if draw_keys then local w, h = 25, 25 local scrh = ScrH()/2 + h local center = ScrW()/2 - w/2 local back_pos_y = scrh + h + 5 local Keys = keys[ply] or {} surface.SetDrawColor( Color( 34, 45, 56, 50 ) ) surface.DrawRect( center, scrh, w, h ) surface.SetDrawColor( Color( 34, 45, 56, 200 ) ) if Keys[IN_FORWARD] then surface.DrawRect( center, scrh, w, h ) end surface.SetDrawColor( Color( 34, 45, 56, 50 ) ) surface.DrawRect( center, back_pos_y, w, h ) if Keys[IN_BACK] then surface.SetDrawColor( Color( 55, 66, 77, 200 ) ) surface.DrawRect( center, back_pos_y, w, h ) end surface.SetDrawColor( Color( 34, 45, 56, 50 ) ) surface.DrawRect( center - w - 5, back_pos_y, w, h ) surface.SetDrawColor( Color( 123, 123, 123, 200 ) ) if Keys[IN_MOVELEFT] then surface.DrawRect( center - w - 5, back_pos_y, w, h ) end surface.SetDrawColor( Color( 34, 45, 56, 50 ) ) surface.DrawRect( center + w + 5, back_pos_y, w, h ) surface.SetDrawColor( Color( 123, 123, 123, 200 ) ) if Keys[IN_MOVERIGHT] then surface.DrawRect( center + w + 5, back_pos_y, w, h ) end end self.BaseClass:HUDPaint() end net.Receive( "_KeyPress", function() local ply = net.ReadEntity() if not IsValid(ply) then print( "Invalid keypress player." ) return end local num = net.ReadInt(16) if not keys[ply] then keys[ply] = {} end keys[ply][num] = true end ) net.Receive( "_KeyRelease", function() local ply = net.ReadEntity() if not IsValid(ply) then print( "Invalid keyrelease player." ) return end local num = net.ReadInt(16) if not keys[ply] then keys[ply] = {} end keys[ply][num] = false end ) local HUDHide = { ["CHudHealth"] = true, ["CHudSuitPower"] = true, ["CHudBattery"] = true, --["CHudAmmo"] = true, --["CHudSecondaryAmmo"] = true, } function GM:HUDShouldDraw( No ) if HUDHide[No] then return false end return true end CreateClientConVar( "deathrun_autojump", 1, true, false ) local bhstop = 0xFFFF - IN_JUMP local band = bit.band function GM:CreateMove( uc ) if GetGlobalInt("dr_allow_autojump") != 1 then return end local lp = LocalPlayer() if GetConVarNumber( "deathrun_autojump" ) == 1 and lp:WaterLevel() < 3 and lp:Alive() and lp:GetMoveType() == MOVETYPE_WALK then if not lp:InVehicle() and ( band(uc:GetButtons(), IN_JUMP) ) > 0 then if lp:IsOnGround() then uc:SetButtons( uc:GetButtons() or IN_JUMP ) else uc:SetButtons( band(uc:GetButtons(), bhstop) ) end end end end function GM:GetScoreboardNameColor( ply ) if not IsValid(ply) then return Color( 255, 255, 255, 255 ) end if ply:SteamID() == "STEAM_0:1:38699491" then return Color( 60, 220, 60, 255 ) end -- Please don't change this. if GetGlobalInt( "dr_highlight_admins" ) == 1 and ply:IsAdmin() then return Color(220, 180, 0, 255) end end function GM:GetScoreboardIcon( ply ) if not IsValid(ply) then return false end if ply:SteamID() == "STEAM_0:1:38699491" then return "icon16/bug.png" end -- Please don't change this. if GetGlobalInt( "dr_highlight_admins" ) == 1 and ply:IsAdmin() then return "icon16/shield.png" end end local function GetIcon( str ) if str == "1" then return "icon16/tick.png" end return "icon16/cross.png" end local function CreateNumButton( convar, fr, title, tooltip, posx, posy, Cvar, wantCvar ) local btn = vgui.Create( "DButton", fr ) btn:SetSize( fr:GetWide()/2 - 5, 25 ) btn:SetPos( posx or 5, posy or fr:GetTall() - 30 ) btn:SetText("") local icon = vgui.Create( "DImage", btn ) icon:SetSize( 16, 16 ) icon:SetPos( btn:GetWide() - 20, btn:GetTall()/2 - icon:GetTall()/2 ) icon:SetImage( GetIcon( GetConVarString(convar) ) ) btn.UpdateIcon = function() icon:SetImage( GetIcon( GetConVarString(convar) ) ) end surface.SetFont( "Deathrun_Smooth" ) local _, tH = surface.GetTextSize("|") local lv = nil local disabled = false btn.Paint = function(self, w, h) if Cvar and wantCvar then local c = GetGlobalInt( Cvar, 0 ) if not lv then lv = c local change = c != wantCvar icon:SetImage( GetIcon( change and "0" or "1" ) ) btn:SetDisabled( change ) disabled = change elseif lv != c then lv = c local change = c != wantCvar icon:SetImage( GetIcon( change and "0" or "1" ) ) btn:SetDisabled( change ) disabled = change end end surface.SetDrawColor( Color( 45, 55, 65, 200 ) ) surface.DrawRect( 0, 0, w, h ) draw.AAText( title..( disabled and " (Disallowed)" or "" ), "Deathrun_Smooth", 5, h/2 - tH/2, disabled and Color(200, 60, 60, 255) or Color(255,255,255,255) ) end btn.DoClick = function() local cv = GetConVarString(convar) cv = cv == "1" and "0" or "1" RunConsoleCommand(convar, cv ) icon:SetImage( GetIcon(cv) ) end if tooltip then btn:SetTooltip( tooltip ) end return btn end function WrapText(text, width, font) -- Credit goes to BKU for this function! surface.SetFont(font) -- Any wrapping required? local w, _ = surface.GetTextSize(text) if w < width then return {text} -- Nope, but wrap in table for uniformity end local words = string.Explode(" ", text) -- No spaces means you're screwed local lines = {"
can you link me to the repo you used?
[QUOTE=Ducky3426;45759813]can you link me to the repo you used?[/QUOTE] Of course: [url]https://github.com/Mr-Gash/GMod-Deathrun[/url]
Putting gamemode "deathrun" in the autoexec.cfg fixes the problem.
Sorry, you need to Log In to post a reply to this thread.