Broken Daz Aimbot

Posts 16–19 of 19 · Page 2 of 2
Quote Originally Posted by Mundu View Post
I fixed a bunch of shit and I think I need the modules for the shit to work because I'm horrid at lua.

Modules I want:
dickwrap
notamodule
or just don't use them
Here's what I has so far. It gives these stupid ass errors.

Code:
	

    local file_name = "dump";
     
    local hack = { };
     
    hack.logs = {};
     
    hack.hookcallbacks = {};
     
    hack.hooks = {
            added = {};
            attached = {};
    };
     
    hack.dontaimat = {
    ["STEAM_0:1:65308065"] = true
    }
     
    hack.aimmodels = {
            ["models/combine_scanner.mdl"] = "Scanner.Body",
            ["models/hunter.mdl"] = "MiniStrider.body_joint",
            ["models/combine_turrets/floor_turret.mdl"] = "Barrel",
            ["models/dog.mdl"] = "Dog_Model.Eye",
            ["models/antlion.mdl"] = "Antlion.Body_Bone",
            ["models/antlion_guard.mdl"] = "Antlion_Guard.Body",
            ["models/antlion_worker.mdl"] = "Antlion.Head_Bone",
            ["models/zombie/fast_torso.mdl"] = "ValveBiped.HC_BodyCube",
            ["models/zombie/fast.mdl"] = "ValveBiped.HC_BodyCube",
            ["models/headcrabclassic.mdl"] = "HeadcrabClassic.SpineControl",
            ["models/headcrabblack.mdl"] = "HCBlack.body",
            ["models/headcrab.mdl"] = "HCFast.body",
            ["models/zombie/poison.mdl"] = "ValveBiped.Headcrab_Cube1",
            ["models/zombie/classic.mdl"] = "ValveBiped.HC_Body_Bone",
            ["models/zombie/classic_torso.mdl"] = "ValveBiped.HC_Body_Bone",
            ["models/zombie/zombie_soldier.mdl"] = "ValveBiped.HC_Body_Bone",
            ["models/combine_strider.mdl"] = "Combine_Strider.Body_Bone",
            ["models/lamarr.mdl"] = "HeadcrabClassic.SpineControl"
    }
     
    hack.zombies = {
            "gmodz_fastmob",
            "gmodz_mob",
            "npc_crow"
    }
     
    local ply = nil;
    local G, R = table.Copy( _G ), debug.getregistry();
    local _R = debug.getregistry();
     
    function hack:Log( msg )
            self.logs[msg] = true;
            MsgN( string.format( "[Herpes]: %s", msg ) );
    end
     
    function hack:IsInGlobals( func, tbl, scanned )
            scanned = scanned || {};
            for name, object in pairs( tbl ) do
                    if( name == func ) then
                            return true;
                    end
                    if( type( object ) == "table" && !scanned[name] ) then
                            scanned[name] = true;
                            local lib = self:IsInGlobals( func, object, scanned );
                            if( lib == true ) then
                                    return true;
                            end
                    end
            end
    end
     
    function hack:LoadLibrary( lib )
            if( self:IsInGlobals( lib, _G ) == true ) then
                    return;
            end
            require( lib );
            G[lib] = _G[lib];
            self:Log( G.string.format( "Loaded library %s.", lib ) );
    end
     
    function hack:FindSafeTable( name )
            if( package.loaded[name] ) then
                    return package.loaded[name];
            elseif( _G[name] ) then
                    if( _G[name]._M ) then
                            return _G[name]._M;
                    end
            end
            return _G[name] || {};
    end
     
    function hack:LocalPlayerValid()
            if( ply == nil || ply && IsValid( ply ) == false ) then
                    ply = LocalPlayer();
            end
            return ( ply != nil && IsValid( ply ) ) && true || false;
    end
     
    G = hack:FindSafeTable( "_G" );
     
    hack:LoadLibrary( "hook" );
    hack:LoadLibrary( "draw" );
    hack:LoadLibrary( "team" );
    hack:LoadLibrary( "timer" );
    hack:LoadLibrary( "weapons" );
    hack:LoadLibrary( "gamemode" );
     
    function hack:RunHook( _hook, _name )
            local htable = hook.GetTable();
            if( htable[_hook] == nil ) then
                    return NULL;
            end
            for name, func in pairs( htable[_hook] ) do
                    if( _name == name ) then
                            func();
                    end
            end
    end
     
    function hack:IsHookResponding( _hook, _name )
            if( self.hookcallbacks[_hook] == nil ) then
                    return false;
            end
            self.hookcallbacks[_hook] = false;
            self:RunHook( _hook, _name );
            return self.hookcallbacks[_hook];
    end
     
    function hack:IsInHookTable( _hook )
            if( hook.GetTable == nil ) then
                    return NULL;
            end
            local htable = hook.GetTable();
            if( type( htable ) != "table" ) then
                    return NULL;
            end
            return htable[_hook] && true || false;
    end
     
    function hack:AttatchToHook( _func, _hook )
     
    end
     
    function hack:DetachHook( _hook, _name )
            if( self.hooks.attached[_hook] == nil ) then
                    return NULL;
            end
            local info = self.hooks.attached[_hook];
            if( info[2] ) then
                    hook.Remove( _hook, _name );
                    hook.Add( _hook, _name, info[2] );
                   
                    self.hooks.attached[_hook] = nil;
                    self:Log( string.format( "Detached function in %s from hook %s.", _name, _hook ) );
                    return true;
            end
            self:Log( string.format( "Failed to detach function in %s from hook %s.", _name, _hook ) );
            return false;
    end
     
    function hack:DefaultHook( _hook, _func )
            local random = math.random( 1, 1000 );
            hook.Add( _hook, random, _func );
            self:Log( string.format( "Added unsafe hook to %s.", _hook ) );
            return random;
    end
     
    function hack:CheckHook( _hook, _name )
            if( self.hooks.attached[_hook] == nil ) then
                    return NULL;
            end
            if( self.hooks.added[_hook] == nil ) then
                    return NULL;
            end
           
            local info = self.hooks.added[_hook];
           
            if( self:IsHookResponding( _hook, _name ) == false ) then
                    self:AddHook( _hook, _name, info[3] );
            end
            return;
    end
     
    function hack:CheckHooking()
            for k, v in pairs( hack.hooks.added ) do
                    hack:CheckHook( k, v[2] );
            end
    end
     
    function hack:AddHook( _hook, _name, _func, _noatt )
            _noatt = _noatt || false;
            local name = "NONE";
            local attachedhook = true;
           
            local name = NULL;
            if( _noatt == false ) then
                    name = "hook"..math.random(1,100000000000000000000)
            end
            if( name == NULL ) then
                    name = self:DefaultHook( _hook, _func );
                    attachedhook = false;
            end
            self.hooks.added[_hook] = { name, _name, _func, attachedhook };
    end
     
    function hack:RemoveHook( _hook, _name )
            if( self.hooks.added[_hook] == nil ) then
                    return NULL;
            end
            for k, v in pairs( self.hooks.added ) do
                    if( _name == v[2] ) then
                            if( v[4] ) then
                                    self:DetachHook( _hook, v[1] );
                            else
                                    hook.Remove( _hook, v[1] );
                            end
                            self.hooks.added[k] = nil;
                           
                            self:Log( string.format( "Removed hook %s", _hook ) );
                            return;
                    end
            end
            self:Log( string.format( "Failed to remove hook %s", _hook ) );
    end
     
    hack.convars = {};
     
    function hack:FindFile()
            return string.format( "%s.txt", file_name );
    end
     
    hack.usefile = hack:FindFile();
     
    function hack:ReadFile()
            if( file.Read( self.usefile ) == "" ) then
                    return;
            end
           
            local data = file.Read( self.usefile );
            if( !data ) then
                    return;
            end
           
            local expand = string.Explode( "\n", data );
           
            local sep = "";
            for k, v in pairs( expand ) do
                    sep = string.Explode( "=", v );
                    if( sep[1] && self.convars[ sep[1] ] ) then
                            if( sep[1] && sep[2] ) then
                                    self.convars[sep[1]].value = sep[2];
                            end
                    else
                            if( sep[1] && sep[2] ) then
                                    self:AddCVar( sep[1], sep[2] );
                            end
                    end
            end
    end
     
    function hack:Write()
            local write = "";
            for k, v in pairs( self.convars ) do
                    if( k && v && v.value ) then
                            write = write .. string.format( "%s=%i\n", k, tonumber( v.value ) );
                    end
            end
            file.Write( hack.usefile, write );
    end
     
    function hack:AddCVar( name, value, help, max, min )
            if( self.convars[name] ) then
                    self.convars[name].help = help;
                    self.convars[name].max = max;
                    self.convars[name].min = min;
                    return;
            end
            local max = max || 1;
            local min = min || 0;
            local help = help || "None.";
           
            local info = {
                    value = value,
                    help = help,
                    max = max,
                    min = min
            };
           
            self.convars[name] = info;
    end
     
    do
            local info = {};
            local cvar;
            local function GetCVar( self, name )
                    if( self.convars[name] == nil ) then
                            return NULL;
                    end
                    cvar = self.convars[name];
                    if( !info[name] ) then
                            info[name] = {};
                            info[name].GetBool = function()
                                    return tonumber( cvar.value ) == 1 && true || false;
                            end
                            info[name].GetInt = function()
                                    return tonumber( cvar.value );
                            end
                            info[name].GetHelp = function()
                                    return tostring( cvar.help );
                            end
                            info[name].GetMax = function()
                                    return tonumber( cvar.max );
                            end
                            info[name].GetMin = function()
                                    return tonumber( cvar.min );
                            end
                    end
                    return info[name];
            end
            local function SetCVar( self, name, value )
                    if( self.convars[name] == nil ) then
                            return NULL;
                    end
                    self.convars[name].value = tonumber( value );
                    self:Write();
            end
            hack.GetCVar = GetCVar;
            hack.SetCVar = SetCVar;
    end
     
    hack.commands = {};
    hack.cmdtoggle = {};
     
    hack.force = {};
    hack._toggle = {};
     
    hack._wait = {};
     
    function hack:AddCommand( command, key )
            hack[command] = false;
            self.commands[command] = key;
    end
     
    function hack:GetCommand( command )
            if( hack[command] == nil ) then
                    return nil;
            end
            return hack[command];
    end
     
    function hack:SetCommand( command, new )
            if( hack[command] == nil ) then
                    return;
            end
            hack[command] = new;
            hack.force[command] = true;
    end
     
    function hack:AddToggle( command, func )
            self.cmdtoggle[command] = func;
    end
     
    function hack:CommandCall()
            if( vgui.CursorVisible() == true ) then
                    return;
            end
            for k, v in pairs( self.commands ) do
                    if( input.IsKeyDown( v ) ) then
                            hack[k] = true;
                            if( hack.force[k] != nil && hack.force[k] == true ) then
                                    hack[k] = false;
                            end
                    else
                            if( hack.force[k] ) then
                                    hack.force[k] = nil;
                            end
                            hack[k] = false;
                    end
            end
            for cmd, func in pairs( self.cmdtoggle ) do
                    if( hack._wait[cmd] == nil ) then
                            hack._wait[cmd] = 0;
                    end
                    if( input.IsKeyDown( v ) && CurTime() >= hack._wait[cmd] && hack._toggle[cmd] == nil ) then
                            func();
                            hack._wait[cmd] = CurTime() + 1;
                    else
                            if( hack._toggle[cmd] ) then
                                    hack._toggle[cmd] = nil;
                            end
                    end
            end
    end
     
    hack.colors = {
            white = G.Color( 255, 255, 255, 255 ),
            black = G.Color( 0, 0, 0, 255 ),
            red = G.Color( 255, 0, 0, 255 ),
            green = G.Color( 0, 255, 0, 255 ),
            purple = G.Color( 163, 73, 164, 255 ),
    };
     
    hack.admin = {
            "IsSuperAdmin",
            "IsAdmin",
            "EV_IsOwner",
            "EV_IsSuperAdmin",
            "EV_IsAdmin",
            "EV_IsRespected",
            "IsRespected",
    }
     
    hack.entity = {};
     
    local vector_null = G.Vector( NULL, NULL, NULL );
     
    function hack:IsValidEntity( ent )
            if( ent == nil ) then return false; end
            if( IsValid( ent ) == false ) then return false; end
            if( Entity.GetMoveType( ent ) == MOVETYPE_NONE ) then return false; end
            if( ent:IsPlayer() ) then
                    if( Player.Alive( ent ) == false ) then return false; end
                    if( Entity.Health( ent ) <= 0 ) then return false; end
                    return true;
            end
            if( ent:IsNPC() ) then
                    return true;
            end
            return false;
    end
     
    function hack:IsValidAimTarget( ent )
            if( self:LocalPlayerValid() == false ) then
                    return false;
            end
            if( IsValid( ent ) == false ) then return false; end
            if( Entity.GetMoveType( ent ) == MOVETYPE_OBSERVER ) then return false; end
            if( hack:IsVisible( ent ) == false ) then return false; end
            if( ent:IsPlayer() ) then
                    if( Player.GetObserverMode( ent ) != OBS_MODE_NONE ) then return false; end
                    if( team.GetName( R.Player.Team( ply ) ):lower():find( "spect" ) ) then return false; end
                    if( GetConVar( "aim_steam" ):GetBool() == true && ply:GetFriendStatus( ent ) == "friend" ) then return false; end
                    if( GetConVar( "aim_team" ):GetBool() == true && ply.Team( ent ) == ply.Team( ply ) ) then return false; end
                    return true;
            end
            if( ent:IsNPC() ) then
                    if( GetConVar( "aim_npc" ):GetBool() == true ) then return false; end
                    return true;
            end
            return false;
    end
     
    function hack:IsAdmin( ent )
            for _, typ in pairs( self.admin ) do
                    if( _R.Player[typ] && _R.Player[typ]( ent ) ) then
                            return true;
                    elseif( _R.Entity[typ] && _R.Entity[typ]( ent ) ) then
                            return true;
                    end
            end
            return false;
    end
     
    do
            local vecBot, vecTop;
            local function GetCoords( self, ent )
                    if( ent == nil ) then
                            return vector_null, vector_null;
                    end
                    vecBot = Entity.GetPos( ent );
                    vecTop = vecBot + Vector( 0, 0, Entity.OBBMaxs( ent ).z );
                    return Vector.ToScreen( vecBot ), Vector.ToScreen( vecTop );
            end
            hack.GetCoords = GetCoords;
    end
     
    hack.hl2 = {
            ["weapon_pistol"] = true,
            ["weapon_357"] = true,
            ["weapon_smg1"] = true,
            ["weapon_ar2"] = true,
            ["weapon_shotgun"] = true
    };
     
    hack.attachments = {
            "head",
            "forward",
            "eyes",
    };
     
    hack.angle = Angle( 0, 0, 0 );
    hack.target = nil;
    hack.locked = false;
     
    hack:AddCommand( "aiming", KEY_B );
     
    hack:AddCVar( "aim_shoot", 1, "Autoshoot" );
    hack:AddCVar( "aim_steam", 1, "Ignore steam friend" );
    hack:AddCVar( "aim_team", 0, "Ignore teammates" );
    hack:AddCVar( "aim_npc", 1, "Ignore NPCs" );
    hack:AddCVar( "aim_recoil", 1, "Norecoil" );
    hack:AddCVar( "aim_prediction", 1, "Prediction" );
    hack:AddCVar( "aim_hold", 0, "Hold target" );
    hack:AddCVar( "aim_drop", 0, "Disable after kill" );
     
    hack:AddCVar( "mis_bhop", 1, "Bunnyhop" );
     
    do
            local pos;
            local function GetHitPos( self, ent )
                    local aimbone = Entity.LookupBone( ent, "ValveBiped.Bip01_Head1" )
                    local fuckedpos = ent:GetShootPos() != nil && ent:GetShootPos() || ent:EyePos()
                    local aimmodels = hack.aimmodels[ent:GetModel()]
                    if( ent == nil ) then return; end
                    if !LocalPlayer():Alive() then return end
                    if( IsValid( ent ) == false ) then return; end
                    for k, att in pairs( self.attachments ) do
                            pos = Entity.GetAttachment( ent, Entity.LookupAttachment( ent, att ) );
                            if( pos ) then // check for attachments first.
                                    return pos.Pos;
                            end
                    end
                    return Entity.GetBonePosition( ent, Entity.LookupBone( ent, "ValveBiped.Bip01_Head1" ) ) //if nothing else to aim at lets aim at the Head bone
            end
            hack.GetHitPos = GetHitPos;
    end
     
    do
            local trace, tr;
            local function IsVisible( self, ent )
                    if( self:LocalPlayerValid() == false ) then
                            return false;
                    end
                    trace = {
                            start = Player.GetShootPos( ply ),
                            endpos = self:GetHitPos( ent ),
                            filter = { ply, ent },
                            mask = MASK_SHOT
                    };
                    tr = util.TraceLine( trace );
                    if( tr == nil ) then return false; end
                    return tr.Fraction == 1 && true || false;
            end
            hack.IsVisible = IsVisible;
    end
     
    do
            local entPos, selfPos, selfAng, bdist;
            local function FindTarget( self, ent, cur_dist )
                    cur_dist = cur_dist || 0;
                    if( self:LocalPlayerValid() == false ) then
                            return nil;
                    end
                    if( self:IsValidAimTarget( ent ) == false ) then
                            return nil;
                    end
                    entPos, selfPos, selfAng = Entity.EyePos( ent ), Entity.EyePos( ply ), Player.GetAimVector( ply );
                    bdist = 0;
                    if( bdist < cur_dist || cur_dist == 0 ) then
                            return true, bdist;
                    end
                    return false, 0;
            end
            hack.FindTarget = FindTarget;
    end
     
    do
            local lpos = {};
            local rpos;
            local function RecordPos( ent, pos )
                    if( !lpos[ent] ) then
                            lpos[ent] = {};
                            lpos[ent].pos = pos;
                            lpos[ent].rt = RealTime();
                    end
                    if( lpos[ent].rt != RealTime() ) then
                            lpos[ent].pos = pos;
                    end
                    return lpos[ent].pos;
            end
            local function PredictTarget( self, ent, pos )
                    if( GetConVar( "aim_prediction" ):GetBool() == false ) then
                            return pos;
                    end
                    rpos = lpos[ent] && lpos[ent].pos || nil;
                    RecordPos( ent, pos );
                    if( rpos == nil ) then
                            return pos;
                    end
                    return pos + ( rpos - pos ) / 25
            end
            hack.PredictTarget = PredictTarget;
    end
     
    local function CorrectMovement( ucmd, angle ) //credits to herpes v4/rabidtoaster (correct movement to view angles, was supposed to be used for silent aim.)
            local m = Vector( R.CUserCmd['GetForwardMove']( ucmd ), R.CUserCmd['GetSideMove']( ucmd ), 0 );
            local n = Vector['GetNormal']( m );
            local a = Angle['Forward']( Vector['Angle']( m ) + ( angle - hack.angle ) ) * Vector['Length']( m );
           
            R.CUserCmd['SetForwardMove']( ucmd, a.x )
            R.CUserCmd['SetSideMove']( ucmd, a.y )
    end
     
    do
            local wep, angle;
            local function CorrectRecoil( self, ucmd )
                    if( GetConVar( "aim_recoil" ):GetBool() == false ) then
                            return;
                    end
                    if( !wep || wep && IsValid( wep ) == false ) then
                            return nil;
                    end
                    wep = tostring( wep:GetClass() );
                    if( self.hl2[wep] ) then
                            angle = cmd.GetViewAngles( ucmd ) - ply.GetPunchAngle( ply );
                            cmd.SetViewAngles( ucmd, angle );
                    end
            end
            hack.CorrectRecoil = CorrectRecoil;
    end
     
     
    local function GetWeaponVector( value )
    local s = -value;
    return Vector( s, s, s )
    end
     
    local CONE = {};
     
    local GetWeaponVector2 = GetWeaponVector
     
    CONE["weapon_pistol"] = GetWeaponVector( 0.0100 );
    CONE["weapon_smg1"] = GetWeaponVector( 0.04362 );
    CONE["weapon_ar2"]= GetWeaponVector( 0.02618 );
    CONE["weapon_shotgun"] = GetWeaponVector( 0.08716 );
    CONE["weapon_zs_zombie"] = GetWeaponVector( 0.0 );
    CONE["weapon_zs_fastzombie"] = GetWeaponVector( 0.0 );
    CONE["weapon_zm_sledge"] = GetWeaponVector2(0.09)
    CONE["weapon_zm_rifle"] = GetWeaponVector2(0.005)
    CONE["weapon_zm_pistol"] = GetWeaponVector2(0.02)
    CONE["weapon_zm_mac10"] = GetWeaponVector2(0.03)
    CONE["weapon_ttt_sipistol"] = GetWeaponVector2(0.02)
    CONE["weapon_ttt_m16"] = GetWeaponVector2(0.018)
    CONE["weapon_ttt_glock"] = GetWeaponVector2(0.028)
    CONE["weapon_zm_revolver"] = GetWeaponVector2(0.02)
    CONE["weapon_ttt_mp5"] = GetWeaponVector2(0.03)
    CONE["weapon_ttt_famas"] = GetWeaponVector2(0.025)
    CONE["weapon_ttt_sg552"] = GetWeaponVector2(0.0)
    CONE["weapon_ttt_aug"] = GetWeaponVector2(0.02)
    CONE["weapon_ttt_p90"] = GetWeaponVector2(0.02)
    CONE["weapon_gxysv_galil"] = GetWeaponVector2(0.055)
    CONE["weapon_gxysv_aug"] = GetWeaponVector2(0.03)
    CONE["weapon_gxysv_p90"] = GetWeaponVector2(0.04)
    CONE["weapon_mp5navy"] = GetWeaponVector2(0.019)
    CONE["weapon_sig552"] = GetWeaponVector2(0.02)
    CONE["weapon_ti_p90"] = GetWeaponVector2(0.07)
    CONE["weapon_real_cs_desert_eagle"] = GetWeaponVector2(0.014 )
    CONE["weapon_real_cs_five-seven"] = GetWeaponVector2( 0.011)
    CONE["weapon_real_cs_glock"] = GetWeaponVector2( 0.014)
    CONE["weapon_real_cs_usp"] = GetWeaponVector2(0.0155)
    CONE["weapon_real_cs_p228"] = GetWeaponVector2( 0.0125)
    CONE["weapon_real_cs_p90"] = GetWeaponVector2(0.013 )
    CONE["weapon_real_cs_mp5a5"] = GetWeaponVector2(0.007 )
    CONE["weapon_real_cs_mac10"] = GetWeaponVector2(0.024 )
    CONE["weapon_real_cs_ump_45"] = GetWeaponVector2(0.019 )
    CONE["weapon_real_cs_tmp"] = GetWeaponVector2(0.028 )
    CONE["weapon_real_cs_admin_weapon"] = GetWeaponVector2(0.01 )
    CONE["weapon_real_cs_m4a1"] = GetWeaponVector2(0.012 )
    CONE["weapon_real_cs_g3sg1"] = GetWeaponVector2(0.0035 )
    CONE["weapon_real_cs_galil"] = GetWeaponVector2(0.017 )
    CONE["weapon_real_cs_m249"] = GetWeaponVector2( 0.015)
    CONE["weapon_real_cs_ak47"] = GetWeaponVector2(0.023 )
    CONE["weapon_real_cs_awp"] = GetWeaponVector2(0.0001 )
    CONE["weapon_real_cs_sg552"] = GetWeaponVector2( 0.007)
    CONE["weapon_real_cs_sg550"] = GetWeaponVector2(0.0035 )
    CONE["weapon_real_cs_famas"] = GetWeaponVector2(0.015 )
    CONE["weapon_real_cs_m249"] = GetWeaponVector2(0.015)
    CONE["weapon_real_cs_aug"] = GetWeaponVector2(0.0007)
    CONE["weapon_real_cs_glock18"] = GetWeaponVector2( 0.014)
    CONE["weapon_deagle"] = GetWeaponVector2(0.02 )
    CONE["weapon_fiveseven"] = GetWeaponVector2(0.02 )
    CONE["weapon_p90"] = GetWeaponVector2( 0.02)
    CONE["weapon_ump45"] = GetWeaponVector2( 0.02)
    CONE["weapon_mp5"] = GetWeaponVector2(0.01 )
    CONE["weapon_tmp"] = GetWeaponVector2( 0.04)
    CONE["weapon_famas"] = GetWeaponVector2(0.02 )
    CONE["weapon_ak47"] = GetWeaponVector2( 0.02)
    CONE["weapon_m4"] = GetWeaponVector2( 0.02)
    CONE["weapon_para"] = GetWeaponVector2( 0.05)
    CONE["weapon_sg552"] = GetWeaponVector2( 0.02)
    CONE["weapon_galil"] = GetWeaponVector2( 0.02)
    CONE["weapon_aug"] = GetWeaponVector2( 0.02)
    CONE["weapon_glock"] = GetWeaponVector2( 0.03)
    CONE["weapon_pumpshotgun"] = GetWeaponVector2( 0.01)
    CONE["weapon_mad_galil"] = GetWeaponVector2( 0.017)
    CONE["weapon_mad_357"] = GetWeaponVector2( 0.0125)
    CONE["weapon_mad_glock"] = GetWeaponVector2( 0.014)
    CONE["weapon_mad_p228"] = GetWeaponVector2( 0.0125)
    CONE["weapon_mad_m249"] = GetWeaponVector2( 0.03)
    CONE["weapon_mad_sg552"] = GetWeaponVector2( 0.007)
    CONE["weapon_mad_sg550"] = GetWeaponVector2( 0.00075)
    CONE["weapon_mad_sg550"] = GetWeaponVector2( 0.027)
    CONE["weapon_mad_scout"] = GetWeaponVector2(0.005)
    CONE["weapon_mad_famas"] = GetWeaponVector2(0.015)
    CONE["weapon_mad_famas"] = GetWeaponVector2(0.015)
    CONE["weapon_mad_m4"] = GetWeaponVector2(0.012)
    CONE["weapon_mad_deagle"] = GetWeaponVector2(0.02)
    CONE["weapon_mad_awp"] = GetWeaponVector2(0.005)
    CONE["weapon_fas_sr25"] = GetWeaponVector2(0.005)
    CONE["weapon_fas_m9"] = GetWeaponVector2(0.021)
    CONE["weapon_fas_mp5"] = GetWeaponVector2(0.01)
    CONE["weapon_fas_m4a1"] = GetWeaponVector2(0.005)
    CONE["weapon_fas_m4carb"] = GetWeaponVector2(0.005)
    CONE["weapon_tmp2"] = GetWeaponVector2(0.022)
    CONE["weapon_real_cs_m249"] = GetWeaponVector2(0.015)
    CONE["weapon_hvh_m4a1"] = GetWeaponVector2(0.09)
     
    local BULLET = {};
     
    local oldBullets = _R.Entity.FireBullets;
     
    //eat a dick, no firebullets detour, get your own sluts. - daz, 14/8/13, b4 pub release.
     
    local function PredictSpread( ucmd, angl )
            local wep = LocalPlayer():GetActiveWeapon();
            if( wep && IsValid( wep ) ) then
                    if( !CONE[wep:GetClass()] ) then
     
    end
            return angl;
    end
     
    do
            local tar, angles, lastshoot;
            local function Aimbot( self, ucmd )
     
                    ply = LocalPlayer();
                    self.locked = false;
                    if( ply == nil || ply && IsValid( ply ) == false ) then
                            return;
                    end
                    if( ply:GetMoveType() != MOVETYPE_LADDER && cmd:KeyDown( ucmd, IN_JUMP ) && ply:OnGround() == false ) then
                            cmd:SetButtons( ucmd, cmd:GetButtons( ucmd ) - IN_JUMP );
							else return end
                    end
                    if( ply:Alive() == false ) then
                            return;
                    end
                    if( self:GetCommand( "aiming" ) == false ) then
                            return;
                    end
                    if( self.target == nil ) then
                            return;
                    end
                    angles = self:GetHitPos( self.target ) || vector_null;
                    if( angles == vector_null ) then
                            return;
                    end
                    angles = self:PredictTarget( self.target, angles );
                    angles = Vector.Angle( angles - Player.GetShootPos( ply ) );
                   
                    angles = PredictSpread( ucmd, angles );
     
                    angles.p = math.NormalizeAngle( angles.p );
                    angles.y = math.NormalizeAngle( angles.y );
                    angles.r = 0.00;
                   
                    cmd.SetViewAngles( ucmd, angles );
                   
                    self.angle = cmd.GetViewAngles( ucmd );
                    self.locked = true;
                   
                    CorrectMovement( ucmd, angles );
                    self:CorrectRecoil( ucmd );
                   
                    if( GetConVar( "aim_shoot" ):GetBool() ) then
                            ucmd:SetButtons(bit.bor(ucmd:GetButtons(), IN_ATTACK ))
                    end
            end
            hack.Aimbot = Aimbot;
    end
     
    do
            local tar, dist, b, d, dosearch;
            local function GetEntities( self )
                    self.entity = {};
                    self.target = nil;
                    dist = 0;
                    dosearch = true;
                    if( GetConVar( "aim_hold" ):GetBool() == false && GetConVar( "aim_drop" ):GetBool() == false ) then
                            tar = nil;
                    end
                    if( tar != nil && ( GetConVar( "aim_hold" ):GetBool() == true ) ) then
                            if( IsValid( tar ) && ValidEntity( tar ) ) then
                                    dosearch = false;
                            else
                                    if( GetConVar( "aim_drop" ):GetBool() == true ) then
                                            SetCommand( "aiming", false );
                                    end
                                    tar = nil;
                            end
                    end
                    for k, v in pairs( ents.GetAll() ) do
                            if( ValidEntity( v ) ) then
                                    entity[k] = v;
                                    if( v:IsPlayer() && self.dontaimat[v:SteamID()] ) then continue; end
                                    if( v:IsNPC() && table.HasValue( self.zombies, v:GetClass() ) ) then continue end
                                    if( GAMEMODE.Name:lower( ):find( "stronghold" ) ) then if ( (LocalPlayer():GetColor( ).a ~= 255) and (v:GetColor( ).a ~= 255) ) then return end end
                                    if( vmt.IsDormant(k) == true ) then continue; end;
     
                                    if( GetCommand( "aiming" ) == false ) then
                                            tar = nil;
                                            continue;
                                    end
                                    if( v == ply || dosearch == false ) then
                                            continue;
                                    end
                                    if( tar != nil && ( GetConVar( "aim_drop" ):GetBool() == true ) ) then
                                            if( IsValid( tar ) == false || ValidEntity( tar ) == false ) then
                                                    SetCommand( "aiming", false );
                                                    tar = nil;
                                                    continue;
                                            end
                                    end
                                    b, d = FindTarget( v, dist );
                                    if( b == true ) then   
                                            tar = v;
                                            dist = d;
                                    end
                            end
                    end
                    if( GetCommand( "aiming" ) == true ) then
                            if( GetConVar( "aim_drop" ):GetBool() == true && GetConVar( "aim_hold" ):GetBool() == false ) then
                                    if( tar && ValidAimTarget( tar ) == false ) then
                                            tar = nil;
                                            SetCommand( "aiming", false );
                                            return;
                                    end
                            end
                            if( ValidEntity( tar ) ) then
                                    self.target = tar;
                            end
                    end
            end
            hack.GetEntities = GetEntities;
    end
     
    hack.keys = {
            [KEY_A] = "A",
            [KEY_B] = "B",
            [KEY_C] = "C",
            [KEY_D] = "D",
            [KEY_E] = "E",
            [KEY_F] = "F",
            [KEY_G] = "G",
            [KEY_H] = "H",
            [KEY_I] = "I",
            [KEY_J] = "J",
            [KEY_K] = "K",
            [KEY_L] = "L",
            [KEY_M] = "M",
            [KEY_N] = "N",
            [KEY_O] = "O",
            [KEY_P] = "P",
            [KEY_Q] = "Q",
            [KEY_R] = "R",
            [KEY_S] = "S",
            [KEY_T] = "T",
            [KEY_U] = "U",
            [KEY_V] = "V",
            [KEY_W] = "W",
            [KEY_X] = "X",
            [KEY_Y] = "Y",
            [KEY_Z] = "Z",
            [KEY_INSERT] = "Insert",
            [KEY_DELETE] = "Delete",
            [KEY_HOME] = "Home",
    };
     
    hack.blocked = {
            ["con_enable"] = true,
            ["sv_cheats"] = true,
            ["_restart"] = true,
            ["exec"] = true,
            ["condump"] = true,
            ["connect"] = true,
            ["bind"] = true,
            ["BindToggle"] = true,
            ["alias"] = true,
            ["ent_fire"] = true,
            ["ent_setname"] = true,
            ["sensitivity"] = true,
            ["name"] = true,
            ["r_aspect"] = true,
            ["quit"] = true,
            ["exit"] = true,
            ["lua_run"] = true,
            ["lua_run_cl"] = true,
            ["lua_open"] = true,
            ["lua_cookieclear"] = true,
            ["lua_showerrors_cl"] = true,
            ["lua_showerrors_sv"] = true,
            ["lua_openscript"] = true,
            ["lua_openscript_cl"] = true,
            ["lua_redownload"] = true,
            ["sent_reload"] = true,
            ["sent_reload_cl"] = true,
            ["swep_reload"] = true,
            ["swep_reload_cl"] = true,
            ["gamemode_reload"] = true,
            ["gamemode_reload_cl"] = true,
            ["con_logfile"] = true,
            ["clear"] = true,
            ["rcon_password"] = true,
            ["test_RandomChance"] = true,
            ["plugin_load"] = true,
    }
     
    function hack:SetBind( command, key )
            commands[command] = key;
    end
     
    function hack:ReadBindFile()
            if( file.Read( "binds.txt" ) == "" ) then
                    return;
            end
           
            local data = file.Read( "binds.txt" );
            if( !data ) then
                    return;
            end
           
            local expand = string.Explode( "\n", data );
           
            local sep = "";
            for k, v in pairs( expand ) do
                    sep = string.Explode( "=", v );
                    if( sep[1] && commands[ sep[1] ] ) then
                            if( sep[1] && sep[2] ) then
                                    commands[sep[1]] = tonumber( sep[2] );
                            end
                    end
            end
    end
     
    function hack:WriteBindFile()
            local write = "";
            for k, v in pairs( self.commands ) do
                    if( k && v ) then
                            write = write .. string.format( "%s=%i\n", k, v );
                    end
            end
            file.Write( "binds.txt", write );
    end
     
    local function CreateMove( ucmd )
            if( ucmd == nil ) then
                    return;
            end
            hack:Aimbot( ucmd );
    end
     
    local function CalcView( pl, orig, ang, FOV )
            if( GAMEMODE ) then
                    if( hack.locked == false || hack:GetConVar( "aim_recoil" ):GetBool() == false ) then
                            return GAMEMODE:CalcView( ply, orig, ang, FOV );
                    end
                    local view = GAMEMODE:CalcView( ply, orig, hack.angle, FOV ) || {}
                            view.angles = hack.angle;
                            view.angles.r = 0;
                    return view;
            end
            return { player = pl, origin = orig, angles = ang, fov = FOV };
    end
     
    local function Think()
            hack:GetEntities( );
            hack:CommandCall();
    end
     
    print ("Aimbot has loaded")
     
    hook.Add("CreateMove","herpesCreateMove",CreateMove);
    hook.Add("CalcView","herpesCalcView",CalcView);
    hook.Add("HUDPaint","herpesHUDPaint",HUDPaint);
    hook.Add("RenderScreenspaceEffects","herpesRenderScreenspaceEffects",RenderScreenspaceEffects);
    hook.Add("Think","herpesThink",Think);
     
    hack:ReadFile();
    hack:ReadBindFile();
Quote Originally Posted by Mundu View Post
Here's what I has so far. It gives these stupid ass errors.

Code:
	

    local file_name = "dump";
     
    local hack = { };
     
    hack.logs = {};
     
    hack.hookcallbacks = {};
     
    hack.hooks = {
            added = {};
            attached = {};
    };
     
    hack.dontaimat = {
    ["STEAM_0:1:65308065"] = true
    }
     
    hack.aimmodels = {
            ["models/combine_scanner.mdl"] = "Scanner.Body",
            ["models/hunter.mdl"] = "MiniStrider.body_joint",
            ["models/combine_turrets/floor_turret.mdl"] = "Barrel",
            ["models/dog.mdl"] = "Dog_Model.Eye",
            ["models/antlion.mdl"] = "Antlion.Body_Bone",
            ["models/antlion_guard.mdl"] = "Antlion_Guard.Body",
            ["models/antlion_worker.mdl"] = "Antlion.Head_Bone",
            ["models/zombie/fast_torso.mdl"] = "ValveBiped.HC_BodyCube",
            ["models/zombie/fast.mdl"] = "ValveBiped.HC_BodyCube",
            ["models/headcrabclassic.mdl"] = "HeadcrabClassic.SpineControl",
            ["models/headcrabblack.mdl"] = "HCBlack.body",
            ["models/headcrab.mdl"] = "HCFast.body",
            ["models/zombie/poison.mdl"] = "ValveBiped.Headcrab_Cube1",
            ["models/zombie/classic.mdl"] = "ValveBiped.HC_Body_Bone",
            ["models/zombie/classic_torso.mdl"] = "ValveBiped.HC_Body_Bone",
            ["models/zombie/zombie_soldier.mdl"] = "ValveBiped.HC_Body_Bone",
            ["models/combine_strider.mdl"] = "Combine_Strider.Body_Bone",
            ["models/lamarr.mdl"] = "HeadcrabClassic.SpineControl"
    }
     
    hack.zombies = {
            "gmodz_fastmob",
            "gmodz_mob",
            "npc_crow"
    }
     
    local ply = nil;
    local G, R = table.Copy( _G ), debug.getregistry();
    local _R = debug.getregistry();
     
    function hack:Log( msg )
            self.logs[msg] = true;
            MsgN( string.format( "[Herpes]: %s", msg ) );
    end
     
    function hack:IsInGlobals( func, tbl, scanned )
            scanned = scanned || {};
            for name, object in pairs( tbl ) do
                    if( name == func ) then
                            return true;
                    end
                    if( type( object ) == "table" && !scanned[name] ) then
                            scanned[name] = true;
                            local lib = self:IsInGlobals( func, object, scanned );
                            if( lib == true ) then
                                    return true;
                            end
                    end
            end
    end
     
    function hack:LoadLibrary( lib )
            if( self:IsInGlobals( lib, _G ) == true ) then
                    return;
            end
            require( lib );
            G[lib] = _G[lib];
            self:Log( G.string.format( "Loaded library %s.", lib ) );
    end
     
    function hack:FindSafeTable( name )
            if( package.loaded[name] ) then
                    return package.loaded[name];
            elseif( _G[name] ) then
                    if( _G[name]._M ) then
                            return _G[name]._M;
                    end
            end
            return _G[name] || {};
    end
     
    function hack:LocalPlayerValid()
            if( ply == nil || ply && IsValid( ply ) == false ) then
                    ply = LocalPlayer();
            end
            return ( ply != nil && IsValid( ply ) ) && true || false;
    end
     
    G = hack:FindSafeTable( "_G" );
     
    hack:LoadLibrary( "hook" );
    hack:LoadLibrary( "draw" );
    hack:LoadLibrary( "team" );
    hack:LoadLibrary( "timer" );
    hack:LoadLibrary( "weapons" );
    hack:LoadLibrary( "gamemode" );
     
    function hack:RunHook( _hook, _name )
            local htable = hook.GetTable();
            if( htable[_hook] == nil ) then
                    return NULL;
            end
            for name, func in pairs( htable[_hook] ) do
                    if( _name == name ) then
                            func();
                    end
            end
    end
     
    function hack:IsHookResponding( _hook, _name )
            if( self.hookcallbacks[_hook] == nil ) then
                    return false;
            end
            self.hookcallbacks[_hook] = false;
            self:RunHook( _hook, _name );
            return self.hookcallbacks[_hook];
    end
     
    function hack:IsInHookTable( _hook )
            if( hook.GetTable == nil ) then
                    return NULL;
            end
            local htable = hook.GetTable();
            if( type( htable ) != "table" ) then
                    return NULL;
            end
            return htable[_hook] && true || false;
    end
     
    function hack:AttatchToHook( _func, _hook )
     
    end
     
    function hack:DetachHook( _hook, _name )
            if( self.hooks.attached[_hook] == nil ) then
                    return NULL;
            end
            local info = self.hooks.attached[_hook];
            if( info[2] ) then
                    hook.Remove( _hook, _name );
                    hook.Add( _hook, _name, info[2] );
                   
                    self.hooks.attached[_hook] = nil;
                    self:Log( string.format( "Detached function in %s from hook %s.", _name, _hook ) );
                    return true;
            end
            self:Log( string.format( "Failed to detach function in %s from hook %s.", _name, _hook ) );
            return false;
    end
     
    function hack:DefaultHook( _hook, _func )
            local random = math.random( 1, 1000 );
            hook.Add( _hook, random, _func );
            self:Log( string.format( "Added unsafe hook to %s.", _hook ) );
            return random;
    end
     
    function hack:CheckHook( _hook, _name )
            if( self.hooks.attached[_hook] == nil ) then
                    return NULL;
            end
            if( self.hooks.added[_hook] == nil ) then
                    return NULL;
            end
           
            local info = self.hooks.added[_hook];
           
            if( self:IsHookResponding( _hook, _name ) == false ) then
                    self:AddHook( _hook, _name, info[3] );
            end
            return;
    end
     
    function hack:CheckHooking()
            for k, v in pairs( hack.hooks.added ) do
                    hack:CheckHook( k, v[2] );
            end
    end
     
    function hack:AddHook( _hook, _name, _func, _noatt )
            _noatt = _noatt || false;
            local name = "NONE";
            local attachedhook = true;
           
            local name = NULL;
            if( _noatt == false ) then
                    name = "hook"..math.random(1,100000000000000000000)
            end
            if( name == NULL ) then
                    name = self:DefaultHook( _hook, _func );
                    attachedhook = false;
            end
            self.hooks.added[_hook] = { name, _name, _func, attachedhook };
    end
     
    function hack:RemoveHook( _hook, _name )
            if( self.hooks.added[_hook] == nil ) then
                    return NULL;
            end
            for k, v in pairs( self.hooks.added ) do
                    if( _name == v[2] ) then
                            if( v[4] ) then
                                    self:DetachHook( _hook, v[1] );
                            else
                                    hook.Remove( _hook, v[1] );
                            end
                            self.hooks.added[k] = nil;
                           
                            self:Log( string.format( "Removed hook %s", _hook ) );
                            return;
                    end
            end
            self:Log( string.format( "Failed to remove hook %s", _hook ) );
    end
     
    hack.convars = {};
     
    function hack:FindFile()
            return string.format( "%s.txt", file_name );
    end
     
    hack.usefile = hack:FindFile();
     
    function hack:ReadFile()
            if( file.Read( self.usefile ) == "" ) then
                    return;
            end
           
            local data = file.Read( self.usefile );
            if( !data ) then
                    return;
            end
           
            local expand = string.Explode( "\n", data );
           
            local sep = "";
            for k, v in pairs( expand ) do
                    sep = string.Explode( "=", v );
                    if( sep[1] && self.convars[ sep[1] ] ) then
                            if( sep[1] && sep[2] ) then
                                    self.convars[sep[1]].value = sep[2];
                            end
                    else
                            if( sep[1] && sep[2] ) then
                                    self:AddCVar( sep[1], sep[2] );
                            end
                    end
            end
    end
     
    function hack:Write()
            local write = "";
            for k, v in pairs( self.convars ) do
                    if( k && v && v.value ) then
                            write = write .. string.format( "%s=%i\n", k, tonumber( v.value ) );
                    end
            end
            file.Write( hack.usefile, write );
    end
     
    function hack:AddCVar( name, value, help, max, min )
            if( self.convars[name] ) then
                    self.convars[name].help = help;
                    self.convars[name].max = max;
                    self.convars[name].min = min;
                    return;
            end
            local max = max || 1;
            local min = min || 0;
            local help = help || "None.";
           
            local info = {
                    value = value,
                    help = help,
                    max = max,
                    min = min
            };
           
            self.convars[name] = info;
    end
     
    do
            local info = {};
            local cvar;
            local function GetCVar( self, name )
                    if( self.convars[name] == nil ) then
                            return NULL;
                    end
                    cvar = self.convars[name];
                    if( !info[name] ) then
                            info[name] = {};
                            info[name].GetBool = function()
                                    return tonumber( cvar.value ) == 1 && true || false;
                            end
                            info[name].GetInt = function()
                                    return tonumber( cvar.value );
                            end
                            info[name].GetHelp = function()
                                    return tostring( cvar.help );
                            end
                            info[name].GetMax = function()
                                    return tonumber( cvar.max );
                            end
                            info[name].GetMin = function()
                                    return tonumber( cvar.min );
                            end
                    end
                    return info[name];
            end
            local function SetCVar( self, name, value )
                    if( self.convars[name] == nil ) then
                            return NULL;
                    end
                    self.convars[name].value = tonumber( value );
                    self:Write();
            end
            hack.GetCVar = GetCVar;
            hack.SetCVar = SetCVar;
    end
     
    hack.commands = {};
    hack.cmdtoggle = {};
     
    hack.force = {};
    hack._toggle = {};
     
    hack._wait = {};
     
    function hack:AddCommand( command, key )
            hack[command] = false;
            self.commands[command] = key;
    end
     
    function hack:GetCommand( command )
            if( hack[command] == nil ) then
                    return nil;
            end
            return hack[command];
    end
     
    function hack:SetCommand( command, new )
            if( hack[command] == nil ) then
                    return;
            end
            hack[command] = new;
            hack.force[command] = true;
    end
     
    function hack:AddToggle( command, func )
            self.cmdtoggle[command] = func;
    end
     
    function hack:CommandCall()
            if( vgui.CursorVisible() == true ) then
                    return;
            end
            for k, v in pairs( self.commands ) do
                    if( input.IsKeyDown( v ) ) then
                            hack[k] = true;
                            if( hack.force[k] != nil && hack.force[k] == true ) then
                                    hack[k] = false;
                            end
                    else
                            if( hack.force[k] ) then
                                    hack.force[k] = nil;
                            end
                            hack[k] = false;
                    end
            end
            for cmd, func in pairs( self.cmdtoggle ) do
                    if( hack._wait[cmd] == nil ) then
                            hack._wait[cmd] = 0;
                    end
                    if( input.IsKeyDown( v ) && CurTime() >= hack._wait[cmd] && hack._toggle[cmd] == nil ) then
                            func();
                            hack._wait[cmd] = CurTime() + 1;
                    else
                            if( hack._toggle[cmd] ) then
                                    hack._toggle[cmd] = nil;
                            end
                    end
            end
    end
     
    hack.colors = {
            white = G.Color( 255, 255, 255, 255 ),
            black = G.Color( 0, 0, 0, 255 ),
            red = G.Color( 255, 0, 0, 255 ),
            green = G.Color( 0, 255, 0, 255 ),
            purple = G.Color( 163, 73, 164, 255 ),
    };
     
    hack.admin = {
            "IsSuperAdmin",
            "IsAdmin",
            "EV_IsOwner",
            "EV_IsSuperAdmin",
            "EV_IsAdmin",
            "EV_IsRespected",
            "IsRespected",
    }
     
    hack.entity = {};
     
    local vector_null = G.Vector( NULL, NULL, NULL );
     
    function hack:IsValidEntity( ent )
            if( ent == nil ) then return false; end
            if( IsValid( ent ) == false ) then return false; end
            if( Entity.GetMoveType( ent ) == MOVETYPE_NONE ) then return false; end
            if( ent:IsPlayer() ) then
                    if( Player.Alive( ent ) == false ) then return false; end
                    if( Entity.Health( ent ) <= 0 ) then return false; end
                    return true;
            end
            if( ent:IsNPC() ) then
                    return true;
            end
            return false;
    end
     
    function hack:IsValidAimTarget( ent )
            if( self:LocalPlayerValid() == false ) then
                    return false;
            end
            if( IsValid( ent ) == false ) then return false; end
            if( Entity.GetMoveType( ent ) == MOVETYPE_OBSERVER ) then return false; end
            if( hack:IsVisible( ent ) == false ) then return false; end
            if( ent:IsPlayer() ) then
                    if( Player.GetObserverMode( ent ) != OBS_MODE_NONE ) then return false; end
                    if( team.GetName( R.Player.Team( ply ) ):lower():find( "spect" ) ) then return false; end
                    if( GetConVar( "aim_steam" ):GetBool() == true && ply:GetFriendStatus( ent ) == "friend" ) then return false; end
                    if( GetConVar( "aim_team" ):GetBool() == true && ply.Team( ent ) == ply.Team( ply ) ) then return false; end
                    return true;
            end
            if( ent:IsNPC() ) then
                    if( GetConVar( "aim_npc" ):GetBool() == true ) then return false; end
                    return true;
            end
            return false;
    end
     
    function hack:IsAdmin( ent )
            for _, typ in pairs( self.admin ) do
                    if( _R.Player[typ] && _R.Player[typ]( ent ) ) then
                            return true;
                    elseif( _R.Entity[typ] && _R.Entity[typ]( ent ) ) then
                            return true;
                    end
            end
            return false;
    end
     
    do
            local vecBot, vecTop;
            local function GetCoords( self, ent )
                    if( ent == nil ) then
                            return vector_null, vector_null;
                    end
                    vecBot = Entity.GetPos( ent );
                    vecTop = vecBot + Vector( 0, 0, Entity.OBBMaxs( ent ).z );
                    return Vector.ToScreen( vecBot ), Vector.ToScreen( vecTop );
            end
            hack.GetCoords = GetCoords;
    end
     
    hack.hl2 = {
            ["weapon_pistol"] = true,
            ["weapon_357"] = true,
            ["weapon_smg1"] = true,
            ["weapon_ar2"] = true,
            ["weapon_shotgun"] = true
    };
     
    hack.attachments = {
            "head",
            "forward",
            "eyes",
    };
     
    hack.angle = Angle( 0, 0, 0 );
    hack.target = nil;
    hack.locked = false;
     
    hack:AddCommand( "aiming", KEY_B );
     
    hack:AddCVar( "aim_shoot", 1, "Autoshoot" );
    hack:AddCVar( "aim_steam", 1, "Ignore steam friend" );
    hack:AddCVar( "aim_team", 0, "Ignore teammates" );
    hack:AddCVar( "aim_npc", 1, "Ignore NPCs" );
    hack:AddCVar( "aim_recoil", 1, "Norecoil" );
    hack:AddCVar( "aim_prediction", 1, "Prediction" );
    hack:AddCVar( "aim_hold", 0, "Hold target" );
    hack:AddCVar( "aim_drop", 0, "Disable after kill" );
     
    hack:AddCVar( "mis_bhop", 1, "Bunnyhop" );
     
    do
            local pos;
            local function GetHitPos( self, ent )
                    local aimbone = Entity.LookupBone( ent, "ValveBiped.Bip01_Head1" )
                    local fuckedpos = ent:GetShootPos() != nil && ent:GetShootPos() || ent:EyePos()
                    local aimmodels = hack.aimmodels[ent:GetModel()]
                    if( ent == nil ) then return; end
                    if !LocalPlayer():Alive() then return end
                    if( IsValid( ent ) == false ) then return; end
                    for k, att in pairs( self.attachments ) do
                            pos = Entity.GetAttachment( ent, Entity.LookupAttachment( ent, att ) );
                            if( pos ) then // check for attachments first.
                                    return pos.Pos;
                            end
                    end
                    return Entity.GetBonePosition( ent, Entity.LookupBone( ent, "ValveBiped.Bip01_Head1" ) ) //if nothing else to aim at lets aim at the Head bone
            end
            hack.GetHitPos = GetHitPos;
    end
     
    do
            local trace, tr;
            local function IsVisible( self, ent )
                    if( self:LocalPlayerValid() == false ) then
                            return false;
                    end
                    trace = {
                            start = Player.GetShootPos( ply ),
                            endpos = self:GetHitPos( ent ),
                            filter = { ply, ent },
                            mask = MASK_SHOT
                    };
                    tr = util.TraceLine( trace );
                    if( tr == nil ) then return false; end
                    return tr.Fraction == 1 && true || false;
            end
            hack.IsVisible = IsVisible;
    end
     
    do
            local entPos, selfPos, selfAng, bdist;
            local function FindTarget( self, ent, cur_dist )
                    cur_dist = cur_dist || 0;
                    if( self:LocalPlayerValid() == false ) then
                            return nil;
                    end
                    if( self:IsValidAimTarget( ent ) == false ) then
                            return nil;
                    end
                    entPos, selfPos, selfAng = Entity.EyePos( ent ), Entity.EyePos( ply ), Player.GetAimVector( ply );
                    bdist = 0;
                    if( bdist < cur_dist || cur_dist == 0 ) then
                            return true, bdist;
                    end
                    return false, 0;
            end
            hack.FindTarget = FindTarget;
    end
     
    do
            local lpos = {};
            local rpos;
            local function RecordPos( ent, pos )
                    if( !lpos[ent] ) then
                            lpos[ent] = {};
                            lpos[ent].pos = pos;
                            lpos[ent].rt = RealTime();
                    end
                    if( lpos[ent].rt != RealTime() ) then
                            lpos[ent].pos = pos;
                    end
                    return lpos[ent].pos;
            end
            local function PredictTarget( self, ent, pos )
                    if( GetConVar( "aim_prediction" ):GetBool() == false ) then
                            return pos;
                    end
                    rpos = lpos[ent] && lpos[ent].pos || nil;
                    RecordPos( ent, pos );
                    if( rpos == nil ) then
                            return pos;
                    end
                    return pos + ( rpos - pos ) / 25
            end
            hack.PredictTarget = PredictTarget;
    end
     
    local function CorrectMovement( ucmd, angle ) //credits to herpes v4/rabidtoaster (correct movement to view angles, was supposed to be used for silent aim.)
            local m = Vector( R.CUserCmd['GetForwardMove']( ucmd ), R.CUserCmd['GetSideMove']( ucmd ), 0 );
            local n = Vector['GetNormal']( m );
            local a = Angle['Forward']( Vector['Angle']( m ) + ( angle - hack.angle ) ) * Vector['Length']( m );
           
            R.CUserCmd['SetForwardMove']( ucmd, a.x )
            R.CUserCmd['SetSideMove']( ucmd, a.y )
    end
     
    do
            local wep, angle;
            local function CorrectRecoil( self, ucmd )
                    if( GetConVar( "aim_recoil" ):GetBool() == false ) then
                            return;
                    end
                    if( !wep || wep && IsValid( wep ) == false ) then
                            return nil;
                    end
                    wep = tostring( wep:GetClass() );
                    if( self.hl2[wep] ) then
                            angle = cmd.GetViewAngles( ucmd ) - ply.GetPunchAngle( ply );
                            cmd.SetViewAngles( ucmd, angle );
                    end
            end
            hack.CorrectRecoil = CorrectRecoil;
    end
     
     
    local function GetWeaponVector( value )
    local s = -value;
    return Vector( s, s, s )
    end
     
    local CONE = {};
     
    local GetWeaponVector2 = GetWeaponVector
     
    CONE["weapon_pistol"] = GetWeaponVector( 0.0100 );
    CONE["weapon_smg1"] = GetWeaponVector( 0.04362 );
    CONE["weapon_ar2"]= GetWeaponVector( 0.02618 );
    CONE["weapon_shotgun"] = GetWeaponVector( 0.08716 );
    CONE["weapon_zs_zombie"] = GetWeaponVector( 0.0 );
    CONE["weapon_zs_fastzombie"] = GetWeaponVector( 0.0 );
    CONE["weapon_zm_sledge"] = GetWeaponVector2(0.09)
    CONE["weapon_zm_rifle"] = GetWeaponVector2(0.005)
    CONE["weapon_zm_pistol"] = GetWeaponVector2(0.02)
    CONE["weapon_zm_mac10"] = GetWeaponVector2(0.03)
    CONE["weapon_ttt_sipistol"] = GetWeaponVector2(0.02)
    CONE["weapon_ttt_m16"] = GetWeaponVector2(0.018)
    CONE["weapon_ttt_glock"] = GetWeaponVector2(0.028)
    CONE["weapon_zm_revolver"] = GetWeaponVector2(0.02)
    CONE["weapon_ttt_mp5"] = GetWeaponVector2(0.03)
    CONE["weapon_ttt_famas"] = GetWeaponVector2(0.025)
    CONE["weapon_ttt_sg552"] = GetWeaponVector2(0.0)
    CONE["weapon_ttt_aug"] = GetWeaponVector2(0.02)
    CONE["weapon_ttt_p90"] = GetWeaponVector2(0.02)
    CONE["weapon_gxysv_galil"] = GetWeaponVector2(0.055)
    CONE["weapon_gxysv_aug"] = GetWeaponVector2(0.03)
    CONE["weapon_gxysv_p90"] = GetWeaponVector2(0.04)
    CONE["weapon_mp5navy"] = GetWeaponVector2(0.019)
    CONE["weapon_sig552"] = GetWeaponVector2(0.02)
    CONE["weapon_ti_p90"] = GetWeaponVector2(0.07)
    CONE["weapon_real_cs_desert_eagle"] = GetWeaponVector2(0.014 )
    CONE["weapon_real_cs_five-seven"] = GetWeaponVector2( 0.011)
    CONE["weapon_real_cs_glock"] = GetWeaponVector2( 0.014)
    CONE["weapon_real_cs_usp"] = GetWeaponVector2(0.0155)
    CONE["weapon_real_cs_p228"] = GetWeaponVector2( 0.0125)
    CONE["weapon_real_cs_p90"] = GetWeaponVector2(0.013 )
    CONE["weapon_real_cs_mp5a5"] = GetWeaponVector2(0.007 )
    CONE["weapon_real_cs_mac10"] = GetWeaponVector2(0.024 )
    CONE["weapon_real_cs_ump_45"] = GetWeaponVector2(0.019 )
    CONE["weapon_real_cs_tmp"] = GetWeaponVector2(0.028 )
    CONE["weapon_real_cs_admin_weapon"] = GetWeaponVector2(0.01 )
    CONE["weapon_real_cs_m4a1"] = GetWeaponVector2(0.012 )
    CONE["weapon_real_cs_g3sg1"] = GetWeaponVector2(0.0035 )
    CONE["weapon_real_cs_galil"] = GetWeaponVector2(0.017 )
    CONE["weapon_real_cs_m249"] = GetWeaponVector2( 0.015)
    CONE["weapon_real_cs_ak47"] = GetWeaponVector2(0.023 )
    CONE["weapon_real_cs_awp"] = GetWeaponVector2(0.0001 )
    CONE["weapon_real_cs_sg552"] = GetWeaponVector2( 0.007)
    CONE["weapon_real_cs_sg550"] = GetWeaponVector2(0.0035 )
    CONE["weapon_real_cs_famas"] = GetWeaponVector2(0.015 )
    CONE["weapon_real_cs_m249"] = GetWeaponVector2(0.015)
    CONE["weapon_real_cs_aug"] = GetWeaponVector2(0.0007)
    CONE["weapon_real_cs_glock18"] = GetWeaponVector2( 0.014)
    CONE["weapon_deagle"] = GetWeaponVector2(0.02 )
    CONE["weapon_fiveseven"] = GetWeaponVector2(0.02 )
    CONE["weapon_p90"] = GetWeaponVector2( 0.02)
    CONE["weapon_ump45"] = GetWeaponVector2( 0.02)
    CONE["weapon_mp5"] = GetWeaponVector2(0.01 )
    CONE["weapon_tmp"] = GetWeaponVector2( 0.04)
    CONE["weapon_famas"] = GetWeaponVector2(0.02 )
    CONE["weapon_ak47"] = GetWeaponVector2( 0.02)
    CONE["weapon_m4"] = GetWeaponVector2( 0.02)
    CONE["weapon_para"] = GetWeaponVector2( 0.05)
    CONE["weapon_sg552"] = GetWeaponVector2( 0.02)
    CONE["weapon_galil"] = GetWeaponVector2( 0.02)
    CONE["weapon_aug"] = GetWeaponVector2( 0.02)
    CONE["weapon_glock"] = GetWeaponVector2( 0.03)
    CONE["weapon_pumpshotgun"] = GetWeaponVector2( 0.01)
    CONE["weapon_mad_galil"] = GetWeaponVector2( 0.017)
    CONE["weapon_mad_357"] = GetWeaponVector2( 0.0125)
    CONE["weapon_mad_glock"] = GetWeaponVector2( 0.014)
    CONE["weapon_mad_p228"] = GetWeaponVector2( 0.0125)
    CONE["weapon_mad_m249"] = GetWeaponVector2( 0.03)
    CONE["weapon_mad_sg552"] = GetWeaponVector2( 0.007)
    CONE["weapon_mad_sg550"] = GetWeaponVector2( 0.00075)
    CONE["weapon_mad_sg550"] = GetWeaponVector2( 0.027)
    CONE["weapon_mad_scout"] = GetWeaponVector2(0.005)
    CONE["weapon_mad_famas"] = GetWeaponVector2(0.015)
    CONE["weapon_mad_famas"] = GetWeaponVector2(0.015)
    CONE["weapon_mad_m4"] = GetWeaponVector2(0.012)
    CONE["weapon_mad_deagle"] = GetWeaponVector2(0.02)
    CONE["weapon_mad_awp"] = GetWeaponVector2(0.005)
    CONE["weapon_fas_sr25"] = GetWeaponVector2(0.005)
    CONE["weapon_fas_m9"] = GetWeaponVector2(0.021)
    CONE["weapon_fas_mp5"] = GetWeaponVector2(0.01)
    CONE["weapon_fas_m4a1"] = GetWeaponVector2(0.005)
    CONE["weapon_fas_m4carb"] = GetWeaponVector2(0.005)
    CONE["weapon_tmp2"] = GetWeaponVector2(0.022)
    CONE["weapon_real_cs_m249"] = GetWeaponVector2(0.015)
    CONE["weapon_hvh_m4a1"] = GetWeaponVector2(0.09)
     
    local BULLET = {};
     
    local oldBullets = _R.Entity.FireBullets;
     
    //eat a dick, no firebullets detour, get your own sluts. - daz, 14/8/13, b4 pub release.
     
    local function PredictSpread( ucmd, angl )
            local wep = LocalPlayer():GetActiveWeapon();
            if( wep && IsValid( wep ) ) then
                    if( !CONE[wep:GetClass()] ) then
     
    end
            return angl;
    end
     
    do
            local tar, angles, lastshoot;
            local function Aimbot( self, ucmd )
     
                    ply = LocalPlayer();
                    self.locked = false;
                    if( ply == nil || ply && IsValid( ply ) == false ) then
                            return;
                    end
                    if( ply:GetMoveType() != MOVETYPE_LADDER && cmd:KeyDown( ucmd, IN_JUMP ) && ply:OnGround() == false ) then
                            cmd:SetButtons( ucmd, cmd:GetButtons( ucmd ) - IN_JUMP );
							else return end
                    end
                    if( ply:Alive() == false ) then
                            return;
                    end
                    if( self:GetCommand( "aiming" ) == false ) then
                            return;
                    end
                    if( self.target == nil ) then
                            return;
                    end
                    angles = self:GetHitPos( self.target ) || vector_null;
                    if( angles == vector_null ) then
                            return;
                    end
                    angles = self:PredictTarget( self.target, angles );
                    angles = Vector.Angle( angles - Player.GetShootPos( ply ) );
                   
                    angles = PredictSpread( ucmd, angles );
     
                    angles.p = math.NormalizeAngle( angles.p );
                    angles.y = math.NormalizeAngle( angles.y );
                    angles.r = 0.00;
                   
                    cmd.SetViewAngles( ucmd, angles );
                   
                    self.angle = cmd.GetViewAngles( ucmd );
                    self.locked = true;
                   
                    CorrectMovement( ucmd, angles );
                    self:CorrectRecoil( ucmd );
                   
                    if( GetConVar( "aim_shoot" ):GetBool() ) then
                            ucmd:SetButtons(bit.bor(ucmd:GetButtons(), IN_ATTACK ))
                    end
            end
            hack.Aimbot = Aimbot;
    end
     
    do
            local tar, dist, b, d, dosearch;
            local function GetEntities( self )
                    self.entity = {};
                    self.target = nil;
                    dist = 0;
                    dosearch = true;
                    if( GetConVar( "aim_hold" ):GetBool() == false && GetConVar( "aim_drop" ):GetBool() == false ) then
                            tar = nil;
                    end
                    if( tar != nil && ( GetConVar( "aim_hold" ):GetBool() == true ) ) then
                            if( IsValid( tar ) && ValidEntity( tar ) ) then
                                    dosearch = false;
                            else
                                    if( GetConVar( "aim_drop" ):GetBool() == true ) then
                                            SetCommand( "aiming", false );
                                    end
                                    tar = nil;
                            end
                    end
                    for k, v in pairs( ents.GetAll() ) do
                            if( ValidEntity( v ) ) then
                                    entity[k] = v;
                                    if( v:IsPlayer() && self.dontaimat[v:SteamID()] ) then continue; end
                                    if( v:IsNPC() && table.HasValue( self.zombies, v:GetClass() ) ) then continue end
                                    if( GAMEMODE.Name:lower( ):find( "stronghold" ) ) then if ( (LocalPlayer():GetColor( ).a ~= 255) and (v:GetColor( ).a ~= 255) ) then return end end
                                    if( vmt.IsDormant(k) == true ) then continue; end;
     
                                    if( GetCommand( "aiming" ) == false ) then
                                            tar = nil;
                                            continue;
                                    end
                                    if( v == ply || dosearch == false ) then
                                            continue;
                                    end
                                    if( tar != nil && ( GetConVar( "aim_drop" ):GetBool() == true ) ) then
                                            if( IsValid( tar ) == false || ValidEntity( tar ) == false ) then
                                                    SetCommand( "aiming", false );
                                                    tar = nil;
                                                    continue;
                                            end
                                    end
                                    b, d = FindTarget( v, dist );
                                    if( b == true ) then   
                                            tar = v;
                                            dist = d;
                                    end
                            end
                    end
                    if( GetCommand( "aiming" ) == true ) then
                            if( GetConVar( "aim_drop" ):GetBool() == true && GetConVar( "aim_hold" ):GetBool() == false ) then
                                    if( tar && ValidAimTarget( tar ) == false ) then
                                            tar = nil;
                                            SetCommand( "aiming", false );
                                            return;
                                    end
                            end
                            if( ValidEntity( tar ) ) then
                                    self.target = tar;
                            end
                    end
            end
            hack.GetEntities = GetEntities;
    end
     
    hack.keys = {
            [KEY_A] = "A",
            [KEY_B] = "B",
            [KEY_C] = "C",
            [KEY_D] = "D",
            [KEY_E] = "E",
            [KEY_F] = "F",
            [KEY_G] = "G",
            [KEY_H] = "H",
            [KEY_I] = "I",
            [KEY_J] = "J",
            [KEY_K] = "K",
            [KEY_L] = "L",
            [KEY_M] = "M",
            [KEY_N] = "N",
            [KEY_O] = "O",
            [KEY_P] = "P",
            [KEY_Q] = "Q",
            [KEY_R] = "R",
            [KEY_S] = "S",
            [KEY_T] = "T",
            [KEY_U] = "U",
            [KEY_V] = "V",
            [KEY_W] = "W",
            [KEY_X] = "X",
            [KEY_Y] = "Y",
            [KEY_Z] = "Z",
            [KEY_INSERT] = "Insert",
            [KEY_DELETE] = "Delete",
            [KEY_HOME] = "Home",
    };
     
    hack.blocked = {
            ["con_enable"] = true,
            ["sv_cheats"] = true,
            ["_restart"] = true,
            ["exec"] = true,
            ["condump"] = true,
            ["connect"] = true,
            ["bind"] = true,
            ["BindToggle"] = true,
            ["alias"] = true,
            ["ent_fire"] = true,
            ["ent_setname"] = true,
            ["sensitivity"] = true,
            ["name"] = true,
            ["r_aspect"] = true,
            ["quit"] = true,
            ["exit"] = true,
            ["lua_run"] = true,
            ["lua_run_cl"] = true,
            ["lua_open"] = true,
            ["lua_cookieclear"] = true,
            ["lua_showerrors_cl"] = true,
            ["lua_showerrors_sv"] = true,
            ["lua_openscript"] = true,
            ["lua_openscript_cl"] = true,
            ["lua_redownload"] = true,
            ["sent_reload"] = true,
            ["sent_reload_cl"] = true,
            ["swep_reload"] = true,
            ["swep_reload_cl"] = true,
            ["gamemode_reload"] = true,
            ["gamemode_reload_cl"] = true,
            ["con_logfile"] = true,
            ["clear"] = true,
            ["rcon_password"] = true,
            ["test_RandomChance"] = true,
            ["plugin_load"] = true,
    }
     
    function hack:SetBind( command, key )
            commands[command] = key;
    end
     
    function hack:ReadBindFile()
            if( file.Read( "binds.txt" ) == "" ) then
                    return;
            end
           
            local data = file.Read( "binds.txt" );
            if( !data ) then
                    return;
            end
           
            local expand = string.Explode( "\n", data );
           
            local sep = "";
            for k, v in pairs( expand ) do
                    sep = string.Explode( "=", v );
                    if( sep[1] && commands[ sep[1] ] ) then
                            if( sep[1] && sep[2] ) then
                                    commands[sep[1]] = tonumber( sep[2] );
                            end
                    end
            end
    end
     
    function hack:WriteBindFile()
            local write = "";
            for k, v in pairs( self.commands ) do
                    if( k && v ) then
                            write = write .. string.format( "%s=%i\n", k, v );
                    end
            end
            file.Write( "binds.txt", write );
    end
     
    local function CreateMove( ucmd )
            if( ucmd == nil ) then
                    return;
            end
            hack:Aimbot( ucmd );
    end
     
    local function CalcView( pl, orig, ang, FOV )
            if( GAMEMODE ) then
                    if( hack.locked == false || hack:GetConVar( "aim_recoil" ):GetBool() == false ) then
                            return GAMEMODE:CalcView( ply, orig, ang, FOV );
                    end
                    local view = GAMEMODE:CalcView( ply, orig, hack.angle, FOV ) || {}
                            view.angles = hack.angle;
                            view.angles.r = 0;
                    return view;
            end
            return { player = pl, origin = orig, angles = ang, fov = FOV };
    end
     
    local function Think()
            hack:GetEntities( );
            hack:CommandCall();
    end
     
    print ("Aimbot has loaded")
     
    hook.Add("CreateMove","herpesCreateMove",CreateMove);
    hook.Add("CalcView","herpesCalcView",CalcView);
    hook.Add("HUDPaint","herpesHUDPaint",HUDPaint);
    hook.Add("RenderScreenspaceEffects","herpesRenderScreenspaceEffects",RenderScreenspaceEffects);
    hook.Add("Think","herpesThink",Think);
     
    hack:ReadFile();
    hack:ReadBindFile();
Jesus christ you're a fuckin' idiot.

I posted on THE FIRST PAGE that THIS WILL NOT WORK OUT OF BOX.

You know that thing called Lua? Yeah, use it to fix this, this is Fr1kin's aimbot (modified very slightly by me.)
I changed a few things and fixed some things. What are you on about?
Posts 16–19 of 19 · Page 2 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us