Just afew questions related to cider.

  1. How do i add a changelog, editable laws tab (for the mayor) and staff list tab to my server? [[DONE CHANGELOG]]
  2. How do i add a vehicle to my server? (just the jeep)
  3. How can i fix the hands swep looking like you hold an invisible pistol [[DONE]]
  4. How do i add custom content to the server, so that people who join are forced to download it?

Thanks alot! i would really appreciate this help as i’m currently learning lua, and finding it quite enjoyable :slight_smile:
and i learn best, by finding out how, remembering this, then doing it again in the future.

The one’s i want to know the most are the one’s in bold.

Bump.

ventmob inspered you or something?

What do you mean by inspered?
if you mean inspired then, No not really, i’ve allways wanted a server of my own, and i enjoy roleplay servers the most, so i got a roleplay server.

1) I already told you and i even gave you the whole code.

2) This has been answered 100 times before SEARCH. Link

3) SEARCH! Link

4) **[G.AddCSLuaFile

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=G.AddCSLuaFile)**

Okay, i got the hands fixed thanks.
also you told me how to add a staff list, that was all, but not a change log, would it be the same? but just change the text.

Yes you could just change the text :rolleyes:

I’m having trouble, i dont understand…

Could I see the 1) code please? :slight_smile:

You could play around with this

[lua]–[[
Name: “cl_changelog.lua”.
Product: “Cider (Roleplay)”.
–]]

local PANEL = {};

– Called when the panel is initialized.
function PANEL:Init()
self:SetSize(cider.menu.width, cider.menu.height - 8);

-- Create a panel list to store the items.
self.itemsList = vgui.Create("DPanelList", self);
self.itemsList:SizeToContents();
self.itemsList:SetPadding(2);
self.itemsList:SetSpacing(3);
self.itemsList:StretchToParent(4, 4, 12, 44);
self.itemsList:EnableVerticalScrollbar();

local text = vgui.Create("cider_Changelog_Text", self);

text:SetText( { "07/02/2011", } );

self.itemsList:AddItem(text);

local text = vgui.Create("cider_Changelog_Text", self);

text:SetText( { 
"- Changed Blaablaa",
"- Changed Blaablaa", 
"- Changed Blalalala", } );

self.itemsList:AddItem(text);

local text = vgui.Create("cider_Changelog_Text", self);

text:SetText( { "06/02/2011", } );

self.itemsList:AddItem(text);

local text = vgui.Create("cider_Changelog_Text", self);

text:SetText( { 
"- Changed Blalala", 
"- Changed blalala..", 
"- And so on.", } );

self.itemsList:AddItem(text);

end;

– Called when the layout should be performed.
function PANEL:PerformLayout()
self:StretchToParent(0, 22, 0, 0);
self.itemsList:StretchToParent(0, 0, 0, 0);
self.itemsList.Paint = function()
surface.SetDrawColor( 0, 0, 0, 0 )
surface.DrawRect( 0, 0, self.itemsList:GetWide(), self.itemsList:GetTall() )
end

end;

– Register the panel.
vgui.Register(“cider_Changelog”, PANEL, “Panel”);

– Define a new panel.
local PANEL = {};

– Called when the panel is initialized.
function PANEL:Init()
self.Paint = function()
surface.SetDrawColor( 190, 190, 190, 315 )
surface.DrawRect( 0, 0, self:GetWide(), self:GetTall() )
end
self.labels = {}; end;

– Set Text.
function PANEL:SetText(text)
for k, v in pairs(self.labels) do v:Remove(); end;

-- Define our x and y positions.
local y = 5;

-- Loop through the text we're given.
for k, v in pairs(text) do
	local label = vgui.Create("DLabel", self);
	
	-- Set the text of the label.
	label:SetText( string.Replace(v, "> ", "") );
	label:SetTextColor( Color(255, 255, 255, 255) );
	label:SizeToContents();
	
	-- Check if the text is supposed to be red.
	if ( string.find(v, "> ") ) then
		label:SetTextColor( Color(150, 255, 100, 255) );
	end;
	
	-- Insert the label into our labels table.
	table.insert(self.labels, label);
	
	-- Increase the y position.
	y = y + label:GetTall() + 8
end;

-- Set the size of the panel.
self:SetSize(cider.menu.width, y);

end;

– Called when the layout should be performed.
function PANEL:PerformLayout()
local y = 5;

-- Loop through all of our labels.
for k, v in pairs(self.labels) do
	self.labels[k]:SetPos(self:GetWide() / 2 - self.labels[k]:GetWide() / 2, y);
	
	-- Increase the y position.
	y = y + self.labels[k]:GetTall() + 8
end;

end;

– Register the panel.
vgui.Register(“cider_Changelog_Text”, PANEL, “DPanel”);[/lua]

And remember to add this in the cl_menu

[lua] self.tabs:AddSheet(“Changelog”, vgui.Create(“cider_Changelog”, self.tabs), “gui/silkicons/arrow_refresh”);[/lua]

And where abouts would that go good sir?

Do you mean where to place this “cl_changelog.lua”?
Well if so in core/derma/here you make cl_changelog.lua.

God a code for a staffl list and editable laws tab? :slight_smile:

If you want the clients to download your custom content from your gamemode folder called “content”
Add this code to init.lua

This is 100% working.
[lua]
GM.Path = “Cider”;

local ClientResources = 0;
local function ProcessFolder ( Location )
for k, v in pairs(file.Find(Location … ‘*’)) do
if file.IsDir(Location … v) then
ProcessFolder(Location … v … ‘/’)
else
local OurLocation = string.gsub(Location … v, ‘…/gamemodes/’ … GM.Path … ‘/content/’, ‘’)
if !string.find(Location, ‘.db’) then
ClientResources = ClientResources + 1;
resource.AddFile(OurLocation);
end
end
end
end

if !SinglePlayer() then
ProcessFolder(’…/gamemodes/’ … GM.Path … ‘/content/models/’);
ProcessFolder(’…/gamemodes/’ … GM.Path … ‘/content/materials/’);
ProcessFolder(’…/gamemodes/’ … GM.Path … ‘/content/sound/’);
ProcessFolder(’…/gamemodes/’ … GM.Path … ‘/content/vgui/’);
ProcessFolder(’…/gamemodes/’ … GM.Path … ‘/content/scope/’);
ProcessFolder(’…/gamemodes/’ … GM.Path … ‘/content/scrips/’);
ProcessFolder(’…/gamemodes/’ … GM.Path … ‘/content/resource/’);

end
[/lua]
Change the ProcessFolders to whatever you have. content/whatever folders you want.
I just added Cider to the GM.Path. Not sure if that is the name of your gamemode folder. Change it to whatever the GAMEMODE FOLDER is called.

And the staff list/laws tab? :slight_smile:

i will try that out later though, thanks.

This isn’t a question this is a request

this sounds exactly like ventmob

i’ve sorted pretty much everything, appart from the editable laws tab, and staff list.