diff --git a/electron.txt b/electron.txt new file mode 100644 index 0000000..3435b2e --- /dev/null +++ b/electron.txt @@ -0,0 +1,7 @@ +"electron" +{ + "base" "base" + "title" "DarkRP" + "maps" "^rp_" + "menusystem" "1" +} \ No newline at end of file diff --git a/gamemode/cl_init.lua b/gamemode/cl_init.lua new file mode 100644 index 0000000..2e7350f --- /dev/null +++ b/gamemode/cl_init.lua @@ -0,0 +1,25 @@ +-- __ _ _______ _ __ +-- / / /\ | | |__ __| | | \ \ +-- / / / \ | |_ __ ___ | | ___ ___| |__ \ \ +-- < < / /\ \ | | '_ ` _ \| |/ _ \/ __| '_ \ > > +-- \ \ / ____ \| | | | | | | | __/ (__| | | | / / +-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ + +include( "shared.lua" ) + +GM.Client = {} + +-- Add all core files + +function GM.Client.Load() + local fol = GM.FolderName .. "/gamemode/core/" + + -- CLient files + local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" ) + for _, file in pairs( clFiles ) do + include( fol .. "client/" .. file ) + end + +end + +GM.Client.Load() \ No newline at end of file diff --git a/gamemode/core/server/sv_player_init.lua b/gamemode/core/server/sv_player_init.lua new file mode 100644 index 0000000..0034506 --- /dev/null +++ b/gamemode/core/server/sv_player_init.lua @@ -0,0 +1,17 @@ +-- __ _ _______ _ __ +-- / / /\ | | |__ __| | | \ \ +-- / / / \ | |_ __ ___ | | ___ ___| |__ \ \ +-- < < / /\ \ | | '_ ` _ \| |/ _ \/ __| '_ \ > > +-- \ \ / ____ \| | | | | | | | __/ (__| | | | / / +-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ + +local ply = FindMetaTable( "Player" ) + +function GM:PlayerSpawn( ply ) + if( !ply:GetModel() || !ply:GetModel() == "" ) then + ply:SetupHands() + else + self.Debug( tostring(ply) .. " doesn't have a valid model." ) + end + self.Debug( tostring( ply ) .. " spawned." ) +end \ No newline at end of file diff --git a/gamemode/core/sh_debug.lua b/gamemode/core/sh_debug.lua new file mode 100644 index 0000000..2b29661 --- /dev/null +++ b/gamemode/core/sh_debug.lua @@ -0,0 +1,20 @@ +-- __ _ _______ _ __ +-- / / /\ | | |__ __| | | \ \ +-- / / / \ | |_ __ ___ | | ___ ___| |__ \ \ +-- < < / /\ \ | | '_ ` _ \| |/ _ \/ __| '_ \ > > +-- \ \ / ____ \| | | | | | | | __/ (__| | | | / / +-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ + +--- This is used for debugging :D + +function GM.Debug( txt ) + if( txt ) then MsgC( Color( 100, 100, 100 ), "[Debug] " .. txt .. "\n" ) else MsgC( Color( 100, 100, 100 ), "[Debug]" .. "\n" ) end +end + +function GM.Error( txt ) + if( txt ) then + MsgC( Color( 255, 10, 10 ), "[ERROR] " .. txt .. "\n" ) + else + return + end +end \ No newline at end of file diff --git a/gamemode/init.lua b/gamemode/init.lua new file mode 100644 index 0000000..7f40ee8 --- /dev/null +++ b/gamemode/init.lua @@ -0,0 +1,39 @@ +-- __ _ _______ _ __ +-- / / /\ | | |__ __| | | \ \ +-- / / / \ | |_ __ ___ | | ___ ___| |__ \ \ +-- < < / /\ \ | | '_ ` _ \| |/ _ \/ __| '_ \ > > +-- \ \ / ____ \| | | | | | | | __/ (__| | | | / / +-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ + +AddCSLuaFile( "cl_init.lua" ) +AddCSLuaFile( "shared.lua" ) + +include( "shared.lua" ) + +GM.Server = {} + +-- Add all core files + +function GM.Server.Load() + local fol = GM.FolderName .. "/gamemode/core/" + + -- Server files + local cFiles = file.Find( fol .. "/server/sv_*.lua", "LUA" ) + for _, file in pairs( cFiles ) do + include( fol .. "server/" .. file ) + end + + -- CLient files + local clFiles = file.Find( fol .. "/client/cl_*.lua", "LUA" ) + for _, file in pairs( clFiles ) do + AddCSLuaFile( fol .. "client/" .. file ) + end + + -- Shared files + local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" ) + for _, file in pairs( shFiles ) do + AddCSLuaFile( fol .. file ) + end +end + +GM.Server.Load() \ No newline at end of file diff --git a/gamemode/shared.lua b/gamemode/shared.lua new file mode 100644 index 0000000..6e4f114 --- /dev/null +++ b/gamemode/shared.lua @@ -0,0 +1,24 @@ +-- __ _ _______ _ __ +-- / / /\ | | |__ __| | | \ \ +-- / / / \ | |_ __ ___ | | ___ ___| |__ \ \ +-- < < / /\ \ | | '_ ` _ \| |/ _ \/ __| '_ \ > > +-- \ \ / ____ \| | | | | | | | __/ (__| | | | / / +-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/ + +GM.Name = "DarkRP" +GM.Author = "AlmTech" +GM.Email = "elias@almtech.se" +GM.Website = "N/A" + +GM.Shared = {} + +function GM.Shared.Load() + local fol = GM.FolderName .. "/gamemode/core/" + + local shFiles = file.Find( fol .. "/sh_*.lua", "LUA" ) + for _, file in pairs( shFiles ) do + include( fol .. file ) + end +end + +GM.Shared.Load() \ No newline at end of file