Dark's scripts V1

Credits
One of the biggest credits to this scripts goes to my good friend Gravko. He taught me many useful tips and tricks with Lua and also let me use his Admin alert script in my script. Very good guy who fixed up a lot of the things I did wrong in the script - Thank you Gravko!
Another big thanks to DeLiGiT. A great guy and awesome Lua coder. Fixed up my X-ray and added his hooking system which is faster and more efficient than the way I was doing it, The script now runs lag free even on large RP servers. Thank you!

Why should I choose s over other clientside script solutions?
We tested s and another client side script available on the workshop on a large DarkRP server. We found that the other script caused a major FPS drop when playing. We found thatscripts did not cause any FPS drop at all due to the hooking system that DeliGit implemented. Although this study was conducted on only one server, we found that Dscripts didn’t lag on other servers too with lots of props. We also have a good user support because when comments are read we will try to add suggestions that people have said. We will also help anyone who is having trouble setting up the script. Also we will add more stuff in updates to come which will help benefit its users.

A step further to stopping the big server men!

The big server men have nothing to do with this.... Please stop.

Your bhop script clearly isn’t very good if the video is any indication, you lose a ton of speed.

edit: Scratch that, the implementation is sound, I think the video just does a bad job of showing it off. However…



setmetatable(_G, {
        ['__index'] = function(self, k)
                if k == "dark" then
                        return dark;
        end
    end,
    ['__newindex'] = function(self, k, v)
                dark.g.rawset(self, k, v);
                if k == "GAMEMODE" then
                        for k,v in dark.g.pairs(GAMEMODE) do
                                dark.old_gm_hooks[k] = v;
            end
                        local GMTbl = GAMEMODE;
                        if !(getmetatable(GMTbl)) then
                                setmetatable(GMTbl, {
                                        ['__newindex'] = function(self, k, v)
                                                dark.old_gm_hooks[k] = v;
                                        end,
                                        ['__call'] = function(self, k, id, v)
                                                if (not dark.gm_hooks[k]) then dark.gm_hooks[k] = {}; end
                                                dark.gm_hooks[k][id] = v
                                                        if (not dark.new_gm_hooks[k]) then
                                                                dark.new_gm_hooks[k] = function(GM, ...)
                                                                        if (dark.old_gm_hooks[k]) then
                                                                                dark.old_gm_hooks[k](GM, ...);
                                                                        end
                                                                        for k,v in dark.g.pairs(dark.gm_hooks[k]) do
                                                                                v(...);
                                                                        end
                                                                end
                                                                dark.DetourFunc(dark.old_gm_hooks[k], dark.new_gm_hooks[k]);
                                                        end    
                                                dark.g.rawset(self, k, dark.new_gm_hooks[k]);
                                        end,
                                        ['__index'] = function(self, k)
                                                local returnval = dark.old_gm_hooks[k] or rawget(self, k);
                                                return returnval
                                        end,
                                });
            end
        end
    end,
});


What the hell is happening here. :v:

“must have for roleplayers”

can you please stop trying to integrate propkill with roleplay? It’s affecting my ability to scam money from little kids and it’s slowing down the Big Server Men’s plans.

Can we ban this guy for releasing xrays and stuff now?

Thanks. I have no idea how to bunnyhop effectively but I use it in propkill and it works fine for me. I’m sure people who know what they are doing will be able to use it.

And that’s DeLigTs hooking system. He showed me how to use it. It’s much better than using the hook.add according to him. He added it in when finishing the optimization of the rest of the script. Had to re-do a whole lot of things but its much more improved and has more features than the original version.

[editline]25th July 2015[/editline]

Why troll?

[editline]25th July 2015[/editline]

Umm this is a clientside script. It only works on servers that allow it (sv_allowcslua 1 servers). Otherwise it won’t work.

Think falcos small scripts by FPtje steamcommunity.com/sharedfiles/filedetails/?id=104808533 or Lennys scripts 2 http://steamcommunity.com/sharedfiles/filedetails/?id=186936307 Both available on the workshop. They are client lua scripts that only work on servers that allow them. This is the same concept , although mine is primarily targeted at propkillers, it can be used on DarkRP too (hence the admin alert feature)

Ages ago you were against Lenny’s Scripts, now you created your own “Perfect for role players!”.

Actually if you read that very old thread I never said anything against lennys scripts - just trying to get a general discussion/opinion going

I don;t like lennys scripts, albeit for different reasons
.
I agree with clientside scripts on DarKRp.

AAAA MY EYES, that’s just horrible. That bullshit detours GM: hooks instead of using proper hook system. No idea why because GM: hooks have lowest priority and can be overridden by custom hooks of other addons. Also all this _G metatable fuckery looks like some lame attempt of anti-cheat bypassing.
EDIT: Wow, looks like it doesn’t return anything from hooks, I wonder how the fuck everything still works after using this bullshit.

No way in HELL this can be better than hook.Add() and no way in HELL this is an “optimization” of anything.

FYI sv_allowcslua does next to jack. It’s trivial to bypass if you have at least some functioning brain cells. Also that’s why people make anti-cheats, they actually DO something unlike this crap convar.

It sounds like you’re just being a dick for the sake of being a dick.

I’ll just ssnip this

That’s pointless and won’t even work because you’re missing an argument to file.Read.

Edit:

why have you copied the registry table and not done anything with it

Dark you gotta stop calling it my hooking system. i only added gm hooks. the setmetatable stuff is from function. the “optimizing” part has nothing to do with the hooks at all. it is faster because in your previous version you called player.Getall 24 times a tick. you even called player.getall inside a for k v loop.
i probebly should have proof read the setmetatable part and shit more before i sent it lol

much love from deligit

[editline]25th July 2015[/editline]

wow people on facepunch are so salty towards darkcide for no reason. its his first lua script. cut him some slack.

i just wanted to show him that he could improve some parts of his script. this is what it looked before




 //DarkCides script! )//
-- Made by Dark, Many thanks to Gravko for the help!--
 
 
print [[______           _    _____ _     _                           _       _         __  
|  _  \         | |  /  __ (_)   | |                         (_)     | |        \ \
| | | |__ _ _ __| | _| /  \/_  __| | ___  ___   ___  ___ _ __ _ _ __ | |_ ___  (_) |
| | | / _` | '__| |/ / |   | |/ _` |/ _ \/ __| / __|/ __| '__| | '_ \| __/ __|   | |
| |/ / (_| | |  |   <| \__/\ | (_| |  __/\__ \ \__ \ (__| |  | | |_) | |_\__ \  _| |
|___/ \__,_|_|  |_|\_\\____/_|\__,_|\___||___/ |___/\___|_|  |_| .__/ \__|___/ (_) |
                                                               | |              /_/
                                                               |_|                  
                                                                                                                                     
                   ---------------------------------
                   -----LIST OF CONSOLE COMMANDS----
                   ---------------------------------
 This version is a prototype, there may be some errors and things that are not finished 
darkcide_xray -- toggles the general xray
darkcide_180 -- Do a 180 flip
darkcidebhop -- toggles bunny hop
darkcide_chat-- toggles the autospam default message is (ooc) Dark is cool!
darkcide_music -- toggles a hl2 song
darkcide_help -- prints this help message in the console
darkcide_adminalert -- Toggles the admin alert
darkide_adminalert_distance -- Admin alert distance
                                                                           ]]
                                                                                                                           
  -----Variables------                                                                                                                       
local surface = surface
local player = player
local draw = draw
local team = team
local LocalPlayer = LocalPlayer
local Color = Color
local showSpectators = true




 
 
 -----Chatmessages and sound-------------
 
surface.PlaySound ( "npc/combine_soldier/vo/off1.wav" )
chat.AddText("DarkCide script loaded successfully!")
chat.AddText("Look in the console for the commands!")
chat.AddText("This is a prototype! ")

if GetConVarNumber("Sv_Cheats") == 1 then
chat.AddText("Sv cheats is on!")
else
chat.AddText("Sv cheats is off!")
end

if GetConVarNumber("sv_allowcslua") == 1 then
chat.AddText("Sv_allowcslua is on!")
else
chat.AddText("Sv_allowcslua is off! How are you running this!?")
end
		

 -------------------NAME/INFO/ESP-----------------
surface.CreateFont( "darkhud",{
font = "Trebuchet24",
size = 15,
weight = 750,
} )
 

function ESP()
for i = 1, #player.GetAll() do
local v = player.GetAll()*
i=i+1
if (v == LocalPlayer()) then continue end;
 
local c = v:LocalToWorld( v:OBBCenter() ):ToScreen()
 
draw.SimpleTextOutlined( v:Name(), "darkhud", c.x, c.y + 20, team.GetColor( v:Team() ), TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT, 1, Color( 9, 94 , 0 ))
draw.SimpleTextOutlined( v:Health(), "darkhud", c.x, c.y - 10, team.GetColor( v:Team() ), TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT, 1, Color( 9, 94 , 0 ))
draw.SimpleTextOutlined( team.GetName( v:Team()), "darkhud", c.x, c.y, team.GetColor( v:Team() ), TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT, 1, Color( 9, 94 , 0 ))
draw.SimpleTextOutlined( v:GetUserGroup(), "darkhud", c.x, c.y + 10, team.GetColor( v:Team() ), TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT, 1, Color( 9, 94 , 0 ))
draw.SimpleTextOutlined( math.Round( v:GetPos():Distance(LocalPlayer():GetPos())), "darkhud", c.x, c.y - 20, team.GetColor( v:Team() ), TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT, 1, Color( 9, 94 , 0))
end
end




 hook.Add("HUDPaint", "esp", ESP)

------------------------showspectators------------
hook.Add("HUDPaint", "SpectatorsListing", function()
        if !showSpectators then return end
        local spectatePlayers = {}
        local x = 0
        for k,v in pairs(player.GetAll()) do
                if v:GetObserverTarget() == LocalPlayer() then
                        table.insert(spectatePlayers, v:Name())
        end
        end
 
        if #spectatePlayers == 0 then return end
 
        local textLength = surface.GetTextSize(table.concat(spectatePlayers) ) / 3
        draw.RoundedBox(1, ScrW() - 180, ScrH() - ScrH() + 15, 150, 30 + textLength, Color(0,0,0,150))
        draw.SimpleText("Spectators", "TabLarge", ScrW() - 140, ScrH() - ScrH() + 18, Color(130, 0, 255, 255))
        draw.SimpleText("Spectators", "TabLarge", ScrW() - 140, ScrH() - ScrH() + 16, Color(0, 255, 25, 255))
 
        for k, v in pairs(spectatePlayers) do
        draw.SimpleText(v, "TabLarge", ScrW() - 140, ScrH() - ScrH() + 37 + x, Color(130, 0, 255, 255))
                draw.SimpleText(v, "TabLarge", ScrW() - 140, ScrH() - ScrH() + 35 + x, Color(75, 255, 25, 255))
        x = x + 15
    end
end)
concommand.Add("showspecs", function(ply, command, args)
     showSpectators = !showSpectators
end)                                                                                                                     
                                                                                                                         

	   
	   
	   
---------bunnyhop-----------------------------
	   
 local shouldbhop = CreateClientConVar("darkcidebhop", "0", true, true)

hook.Add("Think", "thebhophook", function()
        if shouldbhop:GetBool() then
        if (input.IsKeyDown(KEY_SPACE)) then
        if LocalPlayer():IsOnGround() then
        if LocalPlayer():IsTyping() then return end
        RunConsoleCommand("+jump")
        jumped = 1
        else
        RunConsoleCommand("-jump")
        jumped = 0
        end
        elseif LocalPlayer():IsOnGround() then
        if  jumped == 1 then
        RunConsoleCommand("-jump")
        jumped = 0
        end
        end
  
     end
    end)
 

 


----------------------chats--------------------

local chats = CreateClientConVar("darkcide_chat","0",false,false )

hook.Add("Think","chattest",function()
if chats:GetBool() then
	RunConsoleCommand ("say","// Dark Is cool! ")
	
end
end)
	
 -----------------------music player -------
 
 
local function musicsong()
surface.PlaySound "music/HL2_song23_SuitSong3.mp3"
end
concommand.Add("darkcide_music", musicsong)


local function stopsound()
RunConsoleCommand ("stopsound")
end
concommand.Add("darkcide_stopsound", stopsound)






---------------------help menu (notdone)---------------------------
local function helpstuff()
print [[______           _    _____ _     _                           _       _         __  
|  _  \         | |  /  __ (_)   | |                         (_)     | |        \ \
| | | |__ _ _ __| | _| /  \/_  __| | ___  ___   ___  ___ _ __ _ _ __ | |_ ___  (_) |
| | | / _` | '__| |/ / |   | |/ _` |/ _ \/ __| / __|/ __| '__| | '_ \| __/ __|   | |
| |/ / (_| | |  |   <| \__/\ | (_| |  __/\__ \ \__ \ (__| |  | | |_) | |_\__ \  _| |
|___/ \__,_|_|  |_|\_\\____/_|\__,_|\___||___/ |___/\___|_|  |_| .__/ \__|___/ (_) |
                                                               | |              /_/
                                                               |_|                  
                                                                                                                                     
                   ---------------------------------
                   -----LIST OF CONSOLE COMMANDS----
                   ---------------------------------
 This version is a prototype, there may be some errors and things that are not finished 
darkcide_xray -- toggles the general xray props and players
darkcide_180 -- Do a 180 flip
darkcidebhop -- toggles bunny hop
darkcide_chat-- toggles the autospam default message is (ooc) Dark is cool!
darkcide_music -- toggles a hl2 song
darkcide_help -- prints this help message in the console
darkcide_adminalert -- Toggles the admin alert
darkide_adminalert_distance -- Admin alert distance
                                                                           ]]
end
concommand.Add("darkcide_help", helpstuff)
chat.AddText("test... loaded darkcides script :^)")
 
-- I used the concommand because you just want to type the command in once, and then the script will print the stuff.. 
-- I've also removed the hook, and the getbool.. The hook should not be used, as it's just a print command, and needs to be run once. The Getbool was not needed, because.. well yeah, there was no convar :)))))

-- NOTE, next time dont use getbool for these sort of things as Gravko stated above - It's not needed. Hooks aren't needed either as it's only run once, a one time event not ran many times again and again.
---------adminalert---------

CreateClientConVar("darkcide_adminalert", "1", true, false)
CreateClientConVar("darkcide_adminalert_distance", "150", true, false)
hook.Add( "HUDPaint", "adminalertaddon", function()
if GetConVarNumber("darkcide_AdminAlert") != 1 then return end
        for k, v in pairs(player.GetAll()) do
        local amdminipos = v:LocalToWorld(v:OBBCenter()):ToScreen()
        local admindist = math.floor((LocalPlayer():GetPos():Distance( v:GetPos()))/40)
        if v:GetUserGroup() != "user" and v != LocalPlayer() and admindist < tonumber(GetConVarNumber("funtime_AdminAlert_distance")) then
        draw.DrawText( "An admin is nearby!", "DermaLarge", ScrW() * 0.5, ScrH() * 0.7, Color( 255, 0, 0, 255 ), TEXT_ALIGN_CENTER )
        surface.PlaySound ("vo/trainyard/female01/cit_bench01.wav")
        surface.SetDrawColor(255,0,0)
        surface.DrawLine(ScrW() * .5, ScrH() * .5, amdminipos.x, amdminipos.y)
        end
        end
end)

----xray------

CreateClientConVar("darkcide_xray", 0, false, false) 
 
hook.Add("HUDPaint", "darkxray", function()
cam.Start3D()
if GetConVarNumber ("darkcide_xray") == 1 then 
     for k, v in pairs(player.GetAll()) do 
        v:DrawModel() 
    v:SetRenderMode (RENDERMODE_TRANSALPHA) 
    render.MaterialOverride(Material("models/debug/debugwhite")) 
    render.SuppressEngineLighting( true )
    render.SetColorModulation( 1, 1, 1) 
    if v:Health() == 0 or v:Health() < 0 then
    render.SetColorModulation(1, 0, 0)      
        v:DrawModel()  
      end
          
		  
    for k, v in pairs(ents.FindByClass("prop_physics")) do -- findbyclass will give  more accurate stuff hopefully :)
    render.MaterialOverride(Material("models/debug/debugwhite")) -- set the material
    render.SetColorModulation(1, 1, 1) -- setting the color as shown before
    render.SuppressEngineLighting(true) -- suppressenginelightning
    v:DrawModel() -- draw the model
    v:SetColor(Color(255, 255, 255, 0)) -- make it invisible
    v:SetRenderMode( RENDERMODE_TRANSALPHA )
	
	end
end
end
cam.End3D() -- 
end) -- remember to close the hook
 

---- simple 180 command (to be improved)

concommand.Add("darkcide_180", function()
LocalPlayer() :SetEyeAngles ( LocalPlayer():EyeAngles() + Angle( -2 * LocalPlayer():EyeAngles().p,180, 0) )
end)



and this is what it looked like after i had changed some stuff.



-- Made by Dark, Many thanks to Gravko for the help! Special thanks to DeLiGiT for fixing most of the code <3--
print [[______           _    _____ _     _                           _       _         __  
|  _  \         | |  /  __ (_)   | |                         (_)     | |        \ \
| | | |__ _ _ __| | _| /  \/_  __| | ___  ___   ___  ___ _ __ _ _ __ | |_ ___  (_) |
| | | / _` | '__| |/ / |   | |/ _` |/ _ \/ __| / __|/ __| '__| | '_ \| __/ __|   | |
| |/ / (_| | |  |   <| \__/\ | (_| |  __/\__ \ \__ \ (__| |  | | |_) | |_\__ \  _| |
|___/ \__,_|_|  |_|\_\\____/_|\__,_|\___||___/ |___/\___|_|  |_| .__/ \__|___/ (_) |
                                                               | |              /_/
                                                               |_|                  
															   
                   ---------------------------------
                   -----LIST OF CONSOLE COMMANDS----
                   ---------------------------------

dark_xray -- toggles the general xray
dark_180 -- Do a 180 flip
darkbhop -- toggles bunny hop
dark_chat-- toggles the autospam default message is (ooc) Dark is cool!
dark_music -- toggles a hl2 song
dark_help -- prints this help message in the console
dark_adminalert -- Toggles the admin alert
darkide_adminalert_distance -- Admin alert distance
]]

if dark then 
	rawset(_G, "dark", nil)
end

local dark = {} // make local table

dark.g = table.Copy(_G); // copy _G

function dark.Copy(t, lookup_table)
    if (t == nil) then return nil end
    local copy = {}
    setmetatable(copy, getmetatable(t))
        for i,v in pairs(t) do
            if ( !istable(v) ) then
                     copy* = v
                else
                    lookup_table = lookup_table or {}
                    lookup_table[t] = copy
                    if lookup_table[v] then
                        copy* = lookup_table[v] 
                    else
                        copy* = dark.Copy(v,lookup_table) --
                    end
                end
        end
    return copy
end

dark.new_gm_hooks			= {};
dark.gm_hooks				= {};                               
dark.old_gm_hooks			= {};
dark.OrigFuncs				= {};
dark.FakeFuncs				= {};
dark.CmdHooks				= {};
dark.Plys					= {} // table for valid players
dark.me						= dark.g.LocalPlayer()
dark.gm						= table.Copy(GAMEMODE)
dark.cm						= dark.Copy(dark.g.FindMetaTable("CUserCmd")) // we need these
dark.am						= dark.Copy(dark.g.FindMetaTable("Angle")) // we need these
dark.vm						= dark.Copy(dark.g.FindMetaTable("Vector")) // we need these 
dark.wm						= dark.Copy(dark.g.FindMetaTable("Weapon")) // we need these
dark.em						= dark.Copy(dark.g.FindMetaTable("Entity")) // we need these
dark.pm						= dark.Copy(dark.g.FindMetaTable("Player")) // we need these
dark.r						= dark.Copy(dark.g.debug.getregistry()) // we need these
dark.ConCMD					= dark.Copy(concommand)
dark.odbginf				= debug.getinfo;
dark.ogmt					= getmetatable;
dark.shouldbhop				= CreateClientConVar("darkbhop", "0", true, true)
dark.xrei					= CreateClientConVar("dark_xray", 0, false, false) 
dark.adminwarning			= CreateClientConVar("dark_adminalert", "1", true, false)

dark.g.surface.CreateFont(
	"darkhud", {
		font = "Trebuchet24",
		size = 15,
		weight = 750,
	}
)

function dark.DetourFunc(func, newfunc) // luv from deligit to my nigga Function <3
    dark.g.table.insert(dark.OrigFuncs, func);
    dark.g.table.insert(dark.FakeFuncs, newfunc);
end

function dark.CopyTable(t, lookup_table)
    if (t == nil) then return nil end
    local copy = {}
    setmetatable(copy, getmetatable(t))
        for i,v in dark.g.pairs(t) do
            if ( !istable(v) ) then
                     copy* = v
                else
                    lookup_table = lookup_table or {}
                    lookup_table[t] = copy
                    if lookup_table[v] then
                        copy* = lookup_table[v] 
                    else
                        copy* = dark.CopyTable(v,lookup_table) --
                    end
                end
        end
    return copy
end

setmetatable(_G, {
	['__index'] = function(self, k)
		if k == "dark" then
			return dark;
        end
    end,
    ['__newindex'] = function(self, k, v)
		dark.g.rawset(self, k, v);
		if k == "GAMEMODE" then
			for k,v in dark.g.pairs(GAMEMODE) do
				dark.old_gm_hooks[k] = v;
            end
			local GMTbl = GAMEMODE;
			if !(getmetatable(GMTbl)) then
				setmetatable(GMTbl, {
					['__newindex'] = function(self, k, v)
						dark.old_gm_hooks[k] = v;
					end,
					['__call'] = function(self, k, id, v)
						if (not dark.gm_hooks[k]) then dark.gm_hooks[k] = {}; end
						dark.gm_hooks[k][id] = v
							if (not dark.new_gm_hooks[k]) then
								dark.new_gm_hooks[k] = function(GM, ...)
									if (dark.old_gm_hooks[k]) then
										dark.old_gm_hooks[k](GM, ...);
									end
									for k,v in dark.g.pairs(dark.gm_hooks[k]) do
										v(...);
									end
								end
								dark.DetourFunc(dark.old_gm_hooks[k], dark.new_gm_hooks[k]);
							end    
						dark.g.rawset(self, k, dark.new_gm_hooks[k]);
					end,
					['__index'] = function(self, k)
						local returnval = dark.old_gm_hooks[k] or rawget(self, k);
						return returnval
					end,
				});
            end
        end
    end,
});

function dark.Hook(typ, func)
	if dark.gm[typ] and GAMEMODE[typ] then
		GAMEMODE[typ] = function(...)
			dark.gm[typ](...)
			func(...)
		end
	end
end

local ndbginf = function(func, ...)
	local args = {...};
	local targ = func;
	local arg = args[1] or false;
	for i, fakefunc in dark.g.pairs(dark.FakeFuncs) do
		if (func == fakefunc) then
			targ = dark.OrigFuncs*;
			break;
		end
	end
	local tbl = arg and dark.odbginf(targ, arg) or dark.odbginf(targ);
	if (tbl.func) then tbl.func = func; end
	return(tbl)
end
 
local ngmt = function(tbl, ...)
if (dark.gdebug.traceback() and (tbl == _G or tbl == GAMEMODE)) then return nil; end
	return dark.ogmt(tbl, ...);
end

dark.DetourFunc(debug.getinfo,   ndbginf);
debug.getinfo   = ndbginf;

function dark.GetPlys() // faster than calling player.GetAll all the time
	dark.Plys = {}
	local niggs = dark.g.player.GetAll()
	for i = 1, #niggs do
		local v = niggs*
		if (!IsValid(v) || v == dark.me || !v:Alive() || v:Health() < 1) then continue end
		dark.Plys* = v
	end
	dark.g.timer.Simple(2, dark.GetPlys) // better than using hooks, and we dont need to refresh the table every fucking tick
end 

dark.GetPlys()

dark.Hook("DrawOverlay", function(ucmd)
	local niggs = dark.g.player.GetAll()
	for k,v in next, niggs do
		if (!IsValid(v) || v == dark.me || !v:Alive() || v:Health() < 1 || v:Name() == nil) then continue end
		local c = v:LocalToWorld( v:OBBCenter() ):ToScreen()
		dark.g.draw.SimpleTextOutlined( v:Name(), "darkhud", c.x, c.y + 20, team.GetColor( v:Team() ), TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT, 1, Color( 9, 94 , 0 ))
		dark.g.draw.SimpleTextOutlined( v:Health(), "darkhud", c.x, c.y - 10, team.GetColor( v:Team() ), TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT, 1, Color( 9, 94 , 0 ))
		dark.g.draw.SimpleTextOutlined( team.GetName( v:Team()), "darkhud", c.x, c.y, team.GetColor( v:Team() ), TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT, 1, Color( 9, 94 , 0 ))
		dark.g.draw.SimpleTextOutlined( v:GetUserGroup(), "darkhud", c.x, c.y + 10, team.GetColor( v:Team() ), TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT, 1, Color( 9, 94 , 0 ))
		dark.g.draw.SimpleTextOutlined( dark.g.math.Round( v:GetPos():Distance(LocalPlayer():GetPos())), "darkhud", c.x, c.y - 20, team.GetColor( v:Team() ), TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT, 1, Color( 9, 94 , 0))
	end
end)

dark.Hook("CreateMove", function(data, ucmd)
	if (ucmd:KeyDown(2) && !dark.me:IsOnGround() && dark.shouldbhop:GetBool()) then
	ucmd:SetButtons( bit.band( ucmd:GetButtons(), bit.bnot(2) ) );
	end
end)

local pm = FindMetaTable("Player");
 
local ogethands = dark.pm.GetHands; -- Note: Only for c_ viewmodels
 
function pm.GetHands(...)
	return false && ogethands(...);
end

function dark.AdminAlert()
	if dark.adminwarning:GetBool() then
        for k,v in next, dark.Plys do 
			local amdminipos = v:LocalToWorld(v:OBBCenter()):ToScreen()
			local admindist = dark.g.math.floor((LocalPlayer():GetPos():Distance( v:GetPos()))/40)
			if v:GetUserGroup() != "user" and v != LocalPlayer() then
				dark.g.draw.DrawText( "An admin is nearby!", "DermaLarge", ScrW() * 0.5, ScrH() * 0.7, Color( 255, 0, 0, 255 ), TEXT_ALIGN_CENTER )
				dark.g.surface.PlaySound ("vo/trainyard/female01/cit_bench01.wav")
				dark.g.surface.SetDrawColor(255,0,0)
				dark.g.surface.DrawLine(ScrW() * .5, ScrH() * .5, amdminipos.x, amdminipos.y)
			end
		end
	end
end

local chamsmat = dark.g.CreateMaterial("z", "VertexLitGeneric", {
	["$ignorez"] = 1,
	["$model"] = 1,
	["$basetexture"] = "models/debug/debugwhite",
});

local chamsmat2 = dark.g.CreateMaterial("y", "vertexlitgeneric", {
	["$ignorez"] = 0,
	["$model"] = 1,
	["$basetexture"] = "models/debug/debugwhite",
});

dark.xraymat = dark.g.CreateMaterial(dark.g.util.CRC("dark_xraymat"), "VertexLitGeneric", {
	["$basetexture"] = "models/debug/debugwhite"
})

dark.Hook("HUDPaint", function()
	local allprops = dark.g.ents.FindByClass("prop_physics")
	for i = 1, #allprops do
		local v = allprops*
		if !dark.em.IsValid(v) then continue end
		if !dark.xrei:GetBool() then
			dark.em.SetNoDraw(v, false)
			continue
		end
		dark.g.cam.Start3D()
			dark.g.render['SuppressEngineLighting'](true)
			dark.g.render['MaterialOverride'](dark.xraymat)
			dark.g.render.SetColorModulation(1,1,1)
			dark.g.render.SetBlend(1)
			dark.em.DrawModel(v)
			dark.em.SetNoDraw(v, true)
			dark.g.render['SuppressEngineLighting'](false)
			
			dark.em.DrawModel(v)
		dark.g.cam.End3D()
	end
	if !ShowSpec then return end
        local spectatePlayers = {}
        local x = 0
        for k,v in dark.g.next, dark.Plys do
            if v:GetObserverTarget() == LocalPlayer() then
                dark.g.table.insert(spectatePlayers, v:Name())
			end
        end
        if #spectatePlayers == 0 then return end
        local textLength = surface.GetTextSize(dark.g.table.concat(spectatePlayers) ) / 3
        dark.g.draw.RoundedBox(1, ScrW() - 180, ScrH() - ScrH() + 15, 150, 30 + textLength, Color(0,0,0,150))
        dark.g.draw.SimpleText("Spectators", "TabLarge", ScrW() - 140, ScrH() - ScrH() + 18, Color(130, 0, 255, 255))
        dark.g.draw.SimpleText("Spectators", "TabLarge", ScrW() - 140, ScrH() - ScrH() + 16, Color(0, 255, 25, 255))
        for k,v in dark.g.next, spectatePlayers do
        dark.g.draw.SimpleText(v, "TabLarge", ScrW() - 140, ScrH() - ScrH() + 37 + x, Color(130, 0, 255, 255))
                dark.g.draw.SimpleText(v, "TabLarge", ScrW() - 140, ScrH() - ScrH() + 35 + x, Color(75, 255, 25, 255))
        x = x + 15
    end
end)

dark.Hook("RenderScreenspaceEffects", function()
	if dark.xrei:GetBool() then 
		for k,v in dark.g.next, dark.Plys do 
		if(!dark.em.IsValid(v) || dark.em.Health(v) < 1 || v == dark.me || dark.em.IsDormant(v)) then continue; end
			dark.g.cam.Start3D();
				dark.g.render.MaterialOverride(chamsmat);
				dark.g.render.SetColorModulation(1,1,1);
				dark.em.DrawModel(v);
				dark.g.render.SetColorModulation(1,1,1);
				dark.g.render.MaterialOverride(chamsmat2);
				dark.em.DrawModel(v);
			dark.g.cam.End3D();
		end
	end
end)

dark.ConCMD['Add']("dark_openscript", function( ply, cmd, args )
	local lua = dark.g.file.Read( args[1] )
	dark.g.RunString( lua )
end )

dark.ConCMD['Add']("showspecs", function(ply, command, args)
    ShowSpec = !ShowSpec
end)

dark.ConCMD['Add']("dark_180", function()
	LocalPlayer():SetEyeAngles( LocalPlayer():EyeAngles() + Angle( -2 * LocalPlayer():EyeAngles().p,180, 0) )
end)

dark.ConCMD['Add']("dark_music", function()
	dark.g.surface.PlaySound("music/HL2_song23_SuitSong3.mp3")
end)

dark.g.surface.PlaySound("npc/combine_soldier/vo/off1.wav")

dark.g.notification.AddProgress("DeLiGiTwashere", "DarkCides scripts loaded")
dark.g.timer.Simple(5, function() dark.g.notification.Kill("DeLiGiTwashere") end)



i just wanted to show him that he should change some parts of his script. but considerign its his frist ever attempt at lua its not too bad.

for no reason? you should look up his post history

jesus fuck that indentation

LOL the admins are busy playing chess while you are using your haxx

Me and DeliGt are good friends.

[editline]25th July 2015[/editline]

This is the advantage of the addon. You can see what is truely going on in the server. In the admin staff were in the admin area just playing chess… Which is fair play to them because there was hardly anyone on the server and no crimes were being reported.

However you can find out if a server is bad like once I saw 5 admins messing around in the admin area on another server while it went to chaos with mass RDM.

His first ever Lua script is a blatant hodge podge of copypaste without proper indentation, that gives me all the more reason to be “salty” and yes, for a first time script this is absolutely awful, don’t lie to someone in an attempt to make them feel good, be honest with them instead and tell him not to C+P code mindlessly and to learn how to properly indent before he wants to script.

None of it was “copy and pasted” I did that myself, although Gravko did let me use his “admin alert” feature in the script which wasn’t mine.

You are correct though I didn’t know how to indent the code I didn’t think it was that important to be honest as its just readability and I thought as long as I understand it’s fine. But now I see itsimportant for others so DeliGit showed me how to indent correctly.