Results 1 to 2 of 2
  1. #1
    ULt1MaTeGaMErZz's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    0

    Client-Side Freecam [Re-Done from SmegHack]

    The unload doesn't work but it's 6AM and I'm tired af. Hey, at least I understand the code and can make sense of what it does, anyways, here it is:
    Code:
    -- Usage: Get a GLua Loader
    --        Inject the .Dll into the game using any Dll injector
    --		  Press [Home] (Unless you're using a different GLua loader
    -- 		  Paste this code into the loader and run it, once done press insert and you're good to go :) (The unload only closes the menu, doesn't actually unload it ;-;)
    
    -- Thanks to SmegHack for teaching me a bit of GLua and giving me some stuff that I can copy (but I wrote it, I didn't paste it ;)
    -- Freecam Variables --
    local ZESFreecam = {}
    ZESFreecam.Options = {}
    
    ZESFreecam.Options["FC_Toggle"] = false
    ZESFreecam.Options["FC_NoClipSpeed"] = 10
    
    -- Other Variables --
    local MenuOpen = false
    local width, height = 200, 150
    
    -- Fonts --
    surface.CreateFont("Menu_Title", {font = "coolvetica", size = 25})
    surface.CreateFont("Freecam", {font = "Ariel", size = 25})
    
    
    
    -- Functions --
    function Load(Display)
    	concommand.Add("ZESFreecamMenu", DrawMenu)
    	
    	local MenuDelay = false
    	local FCPos, FCAngles, FCEnabled, FCX, FCY, FCDuck, FCJump = LocalPlayer():EyePos(), LocalPlayer():GetAngles(), false, 0, 0, false, false
    
    	-- Hooks --
    	hook.Add("Think", "Menu", function() -- Menu Hook
    		if (input.IsKeyDown(KEY_INSERT) && !MenuDelay) then
    			MenuDelay = true
    			DrawMenu()
    			timer.Simple(.5, function() MenuDelay = false end)
    		end
    	end)
    	
    	hook.Add("CalcView", "FreecamKBController", function(ply, Pos, Ang, FOV)
    		if (ZESFreecam.Options["FC_Toggle"]) then
    			local FCData = {}
    			local Speed = ZESFreecam.Options["FC_NoClipSpeed"] / 5
    			local MouseAngles = Angle(FCY, FCX, 0)
    			
    			if (LocalPlayer():KeyDown(IN_SPEED)) then
    				Speed = Speed * 5
    			end
    			
    			if (LocalPlayer():KeyDown(IN_FORWARD)) then -- Move Forward --
    				FCPos = FCPos + (MouseAngles:Forward() * Speed)
    			end
    			if (LocalPlayer():KeyDown(IN_BACK)) then -- Move Back --
    				FCPos = FCPos - (MouseAngles:Forward() * Speed)
    			end
    			if (LocalPlayer():KeyDown(IN_MOVELEFT)) then -- Move Left --
    				FCPos = FCPos - (MouseAngles:Right() * Speed)
    			end
    			if (LocalPlayer():KeyDown(IN_MOVERIGHT)) then -- Move Right --
    				FCPos = FCPos + (MouseAngles:Right() * Speed)
    			end
    			
    			if (FCJump) then
    				FCPos = FCPos + Vector(0, 0, Speed)
    			end
    			if (FCDuck) then
    				FCPos = FCPos - Vector(0, 0, Speed)
    			end
    			
    			FCData.origin = FCPos;
    			FCData.angles = MouseAngles
    			FCData.fov = FOV
    			FCData.drawviewer = true
    			return FCData;
    		end
    	end)
    	
    	hook.Add("CreateMove", "FreecamMouseController", function(ucmd)
    		if (ZESFreecam.Options["FC_Toggle"]) then
    			if (FCEnabled == false) then
    				FCPos, FCAngles = LocalPlayer():EyePos(), ucmd:GetViewAngles()
    				FCY, FCX = ucmd:GetViewAngles().x, ucmd:GetViewAngles().y
    				FCEnabled = true
    			end
    			ucmd:ClearMovement()
    			
    			if (ucmd:KeyDown(IN_JUMP)) then
    				ucmd:RemoveKey(IN_JUMP)
    				FCJump = true
    			elseif (FCJump) then
    				FCJump = false
    			end
    			
    			if (ucmd:KeyDown(IN_DUCK)) then
    				ucmd:RemoveKey(IN_DUCK)
    				FCDuck = true
    			elseif (FCDuck) then
    				FCDuck = false
    			end
    			
    			FCX = FCX - (ucmd:GetMouseX() / 50)
    			if FCY + (ucmd:GetMouseY() / 50) > 89 then FCY = 89 elseif FCY + (ucmd:GetMouseY() / 50) < -89 then FCY = -89 else FCY = FCY + (ucmd:GetMouseY() / 50) end
    			ucmd:SetViewAngles(FCAngles)
    		elseif (FCEnabled) then 
    			FCEnabled = false 
    		end
    	end)
    end
    
    function DrawMenu()
    	if (MenuOpen) then
    		CloseMenu()
    		return
    	end
    	MenuOpen = true
    	
    	local Menu = vgui.Create("DFrame")
    	Menu:SetTitle("")
    	Menu:ShowCloseButton(false)
    	Menu:SetDraggable(true)
    	Menu:SetSize(width, height)
    	Menu:Center()
    	Menu:MakePopup()
    	function Menu:Paint(w, h)
    		-- Title Bar --
    		draw.RoundedBox(0, 0, 0, w, 24, Color(0, 0, 0, 255))
    		draw.RoundedBox(0, 0, 0, w, h, Color(0, 10, 20, 245))
    		
    		draw.SimpleText("ZESFreecam", "Menu_Title", w/2, 11, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
    	end
    	
    	AddCheckBox(Menu, "ZESFreecam Enabled", width/2-60, 30, "Enabled/Disabled the Freecamera", "FC_Toggle")
    	AddSlider(Menu, "FC_NoClipSpeed", width/2-65, 50, 1, 10)
    	
    	AddGenericButton(Menu, "Unload Hack", 100, 50, width/2-50, height-60, function()
    		CloseMenu()
    		Unload(true)
    	end)
    	
    	function CloseMenu()
    		MenuOpen = false
    		Menu:Close()
    	end
    end
    
    function Unload(Display)
    	concommand.Remove("ZESFreecamMenu")
    end
    
    -- GUI Functions --
    function AddLabel(Parent, Text, PosX, PosY)
    	local AddLabel = vgui.Create("DLabel", Parent)
    	AddLabel:SetText(Text)
    	AddLabel:SetPos(PosX, PosY)
    	AddLabel:SetColor(Color(255, 255, 255, 255))
    	AddLabel:SizeToContents()
    	
    	return AddLabel:GetSize()
    end
    
    function AddCheckBox( Parent, Text, PosX, PosY, ToolTip, Var, ExtraFunc )
    	local AddCheckBox = vgui.Create( "DCheckBoxLabel", Parent )
    	AddCheckBox:SetText( Text )
    	AddCheckBox:SetPos( PosX, PosY )
    	AddCheckBox:SetTooltip( ToolTip )
    	AddCheckBox:SetTextColor( Color(255,255,255,255) )
    	AddCheckBox:SizeToContents()
    	AddCheckBox:SetChecked( ZESFreecam.Options[Var] )
    	AddCheckBox.OnChange = function()
    		ZESFreecam.Options[Var] = AddCheckBox:GetChecked()
    		if ExtraFunc != nil then
    			local IsChecked = AddCheckBox:GetChecked()
    			ExtraFunc()
    		end
    	end
    end
    
    function AddSlider( Parent, Var, PosX, PosY, Min, Max, Decimals )
    	local AddSlider = vgui.Create( "Slider", Parent )
    	AddSlider:SetSize( 150, 15 )
    	AddSlider:SetPos( PosX, PosY )
    	AddSlider:SetMin( Min )
    	AddSlider:SetMax( Max )
    	AddSlider:SetDecimals( Decimals )
    	AddSlider:SetValue( ZESFreecam.Options[Var] )
    	AddSlider.OnValueChanged = function( Panel, Value )
    		ZESFreecam.Options[Var] = math.Round( Value, Decimals )
    	end
    	AddSlider.Paint = function()
    		draw.RoundedBox( 0, 0, 0, 135, 15, Color(255,255,255,255) )
    		surface.SetDrawColor(Color(0,0,0,255))
    		surface.DrawOutlinedRect( 0, 0, 135, 15 )
    		surface.DrawLine( 105, 0, 105, 15 )
    	end
    end
    
    function AddGenericButton( Parent, Text, SizeX, SizeY, PosX, PosY, DoClick )
    	local AddGenericButton = vgui.Create( "DButton", Parent )
    	AddGenericButton:SetText( Text )
    	AddGenericButton:SetTextColor( Color(255,255,255) )
    	AddGenericButton:SetSize( SizeX, SizeY )
    	AddGenericButton:SetPos( PosX, PosY )
    	function AddGenericButton:Paint( w, h )
    		draw.RoundedBox( 0, 0, 0, w, h, Color(150,150,150,255) )
    		
    		surface.SetDrawColor( Color(0,0,0,255) )
    		surface.DrawOutlinedRect( 0, 0, w, h )
    	end
    	AddGenericButton.DoClick = DoClick
    end
    
    Load(true)
    Last edited by Jhem; 10-25-2019 at 02:19 AM. Reason: Rival site has been removed.

  2. #2
    I love myself
    나도 너를 사랑해

    Former Staff
    Premium Member
    Jhem's Avatar
    Join Date
    Mar 2012
    Gender
    male
    Location
    167,646,447
    Posts
    5,150
    Reputation
    1220
    Thanks
    7,394
    My Mood
    Stressed
    Thread moved.

Similar Threads

  1. how to hack the game from client side
    By toolsofpwnage in forum The Division Discussions & Help
    Replies: 14
    Last Post: 03-10-2016, 01:01 AM
  2. Client-Side Level Hack (So Far?)
    By tehcheeseguy in forum Battlefield Heroes Hacks
    Replies: 9
    Last Post: 08-29-2009, 09:16 PM
  3. Replies: 9
    Last Post: 08-23-2009, 06:35 AM
  4. Server Sided VS Client Sided
    By kimodragon in forum Combat Arms Hacks & Cheats
    Replies: 27
    Last Post: 08-27-2008, 07:12 AM
  5. Making a health hack for client side?
    By cool_guy in forum General Game Hacking
    Replies: 7
    Last Post: 03-25-2007, 02:29 PM