Scripts release, updated when possible.

Here are some small scripts people might enjoy, most of them are from the request section and all coded by me. I have been trying to help more people out in the requests section recently so if you want something just post there and I will most likely do it for you.

Witness Display:
[release]
This will display a little box up top that tells you if you are in sight of any other players. Type WitnessToggle in the console to turn it on/off.

http://img838.imageshack.us/img838/2996/38557576.jpg

http://img405.imageshack.us/img405/2820/74132035.jpg

Create a file(WitnessChecker.lua) in your Garrysmod/lua/autorun/client folder and paste this code in then restart garrysmod.
[lua]
local Cap = math.cos(math.rad(45))
local Offset = Vector(0, 0, 32)
local Trace = {}
local WitnessOn = true

local Time = os.time() - 1
local Witnesses = 0
local BeingWitnessed = true
local Texture = surface.GetTextureID(“gui/silkicons/emoticon_smile”)

function WitnessDraw()
if WitnessOn then
if Time < os.time() then
Time = os.time() + .5
Witnesses = 0
BeingWitnessed = false
for _, pl in pairs(player.GetAll()) do
if pl:IsValid() && pl != LocalPlayer() then
Trace.start = LocalPlayer():EyePos() + Offset
Trace.endpos = pl:EyePos() + Offset
Trace.filter = {pl, LocalPlayer()}

				TraceRes = util.TraceLine(Trace)

				if !TraceRes.Hit then
					if (pl:EyeAngles():Forward():DotProduct((LocalPlayer():EyePos() - pl:EyePos()):Normalize()) &gt; Cap) then
						Witnesses = Witnesses + 1
						BeingWitnessed = true
					end
				end
			end
		end
	end

	surface.SetFont("BudgetLabel")
	if BeingWitnessed then
		surface.SetTextColor(255, 000, 000, 255)
		Texture = surface.GetTextureID("gui/silkicons/exclamation")
	else
		surface.SetTextColor(000, 255, 000, 255)
		Texture = surface.GetTextureID("gui/silkicons/emoticon_smile")
	end
	local Text = "Witnesses: "..tostring(Witnesses)
	local Width, Height = surface.GetTextSize(Text)

	surface.SetDrawColor(80, 80, 80, 180)
	surface.DrawRect(ScrW()/2 - (Width/2 + 24), 4, Width + 28, Height + 8)
	surface.SetDrawColor(0, 0, 0, 255)
	surface.DrawOutlinedRect(ScrW()/2 - (Width/2 + 24), 4, Width + 28, Height + 8)

	surface.SetTexture(Texture)
	surface.SetDrawColor(255, 255, 255, 255)
	surface.DrawTexturedRect(ScrW()/2 - (Width/2 + 20), 8, 16, 16)
	surface.SetTextPos(ScrW()/2 - Width/2, 8)
	surface.DrawText(Text)
end

end
hook.Add(“HUDPaint”, “WitnessesBox”, WitnessDraw)

function WitnessToggle(pl, cmd, arg)
if WitnessOn then
WitnessOn = false
else
WitnessOn = true
end
end
concommand.Add(“WitnessToggle”, WitnessToggle)
[/lua]
[/release]

Player Voting System:
[release]
This will set whatever setting on or off if half the server wants it. The right shows how many votes have been placed and how many are required. Type /votemenu in the chat to open/close the menu.

http://img268.imageshack.us/img268/3627/62217569.jpg

http://img339.imageshack.us/img339/9240/28045009.jpg

Create a file(PlayerVoteSystem.lua) in your garrysmod/lua/autorun folder and paste this code in then restart garrysmod.
[lua]
PVS = {}
PVS.Options = {
{Name = “God Mode”, Command = “sbox_godmode”, Votes = {}},
{Name = “Player vs Player”, Command = “sbox_plpldamage”, Votes = {}}
}

if SERVER then
function PVS.OpenMenu(pl, txt, T, D)
if string.lower(string.sub(txt, 1, 9)) == “/votemenu” then
umsg.Start(“TogglePVSVoteMenu”, pl)
umsg.End()
return
end
end
hook.Add(“PlayerSay”, “SayVote”, PVS.OpenMenu)

function PVS.AddVote(pl, cmd, arg)
	local Key = arg[1]
	if !PVS.Options[tonumber(Key)] then return end
	if table.HasValue(PVS.Options[tonumber(Key)].Votes, pl) then return end

	table.insert(PVS.Options[tonumber(Key)].Votes, pl)
	umsg.Start("UpdatePVS", player.GetAll())
		umsg.Long(Key)
		umsg.Long(#PVS.Options[tonumber(Key)].Votes)
	umsg.End()
	if #PVS.Options[tonumber(Key)].Votes &gt;= math.ceil(#player.GetAll()/2) then
		RunConsoleCommand(PVS.Options[tonumber(Key)].Command, "1")
	end
end
concommand.Add("PVS_AddVote", PVS.AddVote)

function PVS.RemoveVote(pl, cmd, arg)
	local Key = arg[1]
	if !PVS.Options[tonumber(Key)] then return end
	if table.HasValue(PVS.Options[tonumber(Key)].Votes, pl) then
		for k, v in pairs(PVS.Options[tonumber(Key)].Votes) do
			if v == pl then
				table.remove(PVS.Options[tonumber(Key)].Votes, k)
				umsg.Start("UpdatePVS", player.GetAll())
					umsg.Long(Key)
					umsg.Long(#PVS.Options[tonumber(Key)].Votes)
				umsg.End()
				if #PVS.Options[tonumber(Key)].Votes &lt; math.ceil(#player.GetAll()/2) then
					RunConsoleCommand(PVS.Options[tonumber(Key)].Command, "0")
				end
			end
		end
	end
end
concommand.Add("PVS_RemoveVote", PVS.RemoveVote)

else
function PVS.ToggleVoteMenu()
if !PVS.Menu then
for k, v in pairs(PVS.Options) do
v.Votes = 0
end
PVS.Menu = vgui.Create(“DFrame”)
PVS.Menu:SetSize(256, (#PVS.Options19)+28)
PVS.Menu:SetPos((ScrW()/2)-(PVS.Menu:GetWide()/2), (ScrH()/2)-PVS.Menu:GetTall())
PVS.Menu:SetTitle(“Player Vote Menu”)
PVS.Menu:ShowCloseButton(true)
PVS.Menu:SetDraggable(false)
PVS.Menu:SetVisible(false)
PVS.Menu.IsOpen = false
PVS.Menu.Paint = function()
surface.SetDrawColor(80, 80, 80, 180)
surface.DrawRect(0 , 0, PVS.Menu:GetWide(), PVS.Menu:GetTall())
surface.SetDrawColor(000, 000, 000, 255)
surface.DrawOutlinedRect(0 , 0, PVS.Menu:GetWide(), PVS.Menu:GetTall())
for k, v in pairs(PVS.Options) do
draw.SimpleText(v.Votes…"/"…math.ceil(#player.GetAll()/2), “Default”, PVS.Menu:GetWide() - 5, (19
(k-1))+26, color_white, 2, 0)
end
end
PVS.Menu.Toggle = function()
if !PVS.Menu.IsOpen then
PVS.Menu.IsOpen = true
RestoreCursorPosition()
PVS.Menu:SetVisible(true)
gui.EnableScreenClicker(true)
else
PVS.Menu:Close()
end
end
PVS.Menu.Close = function()
PVS.Menu.IsOpen = false
RememberCursorPosition()
PVS.Menu:SetVisible(false)
gui.EnableScreenClicker(false)
end

		for k, v in pairs(PVS.Options) do
			local Option = vgui.Create("DCheckBoxLabel", PVS.Menu)
			Option:SetText(v.Name)
			Option:SetPos(7, (19*(k-1))+26)
			Option:SetValue(0)
			Option:SizeToContents()
			Option.OnChange = function()
				if Option:GetChecked() then
					RunConsoleCommand("PVS_AddVote", k)
				else
					RunConsoleCommand("PVS_RemoveVote", k)
				end
			end
		end
	end

	PVS.Menu:Toggle(PVS.Menu.IsOpen)
end
usermessage.Hook("TogglePVSVoteMenu", PVS.ToggleVoteMenu)

function PVS.Update(msg)
	local Key = msg:ReadLong()
	local Votes = msg:ReadLong()
	PVS.Options[tonumber(Key)].Votes = Votes
end
usermessage.Hook("UpdatePVS", PVS.Update)

end
[/lua]
[/release]

Witnesses should be Players In Sight

Witnesses are people who are looking at you, not people you are looking at.