View difference between Paste ID: BjRGUPAz and 8Lb3y9g6
SHOW: | | - or go back to the newest paste.
1
//Aimbot By Logic_Bomb
2
//Tracer Hook Originally by BobFM (Editted By Logic_Bomb)
3
4
/* To Do List
5
6
Aimbot -
7
8
        • Need fix: Aims behind / in front while target is moving parallel to user
9
        • Aim @ closest, specific player, more versatile options [Fixed]
10
        • Crossbow compensation? (Possibility)
11
        • Safe mode - Admin within FoV disables aimbot (togglable)
12
13
+ Derma Controls (Requires complete overhaul of code, however)
14
+ No Recoil (Definitely going to be a team effort)
15
+ Laser sight
16
17
To Do List */
18
19
20
hook.Add("Think", "KeyListener", KeyListener)
21
hook.Add("HUDPaint", "Tracer", Draw)
22
hook.Add("HUDPaint", "AimStats", HUD)
23
hook.Add("Think", "Aimbot", Aim)
24
hook.Add("Think", "Nick_Listener", GetNicks)
25
hook.Add("HUDPaint", "GetDarkRP", GetDRPStats)
26
27
local DebugOn = CreateClientConVar("ae_debug", "0", false, false)
28
29
local FireOn = false
30
local Target = false
31
local TargetOn = false
32
local KeyTimer = tonumber(os.clock())
33
local KeyNow = tonumber(os.clock())
34
35
local DoDraw = false
36
local DoRect = true
37
local DoText = false
38
local DoAim = false
39
local DoTrigger = false
40
local ShowHUD = true
41
42
local DoDarkRP = true
43
44
local SelectedNick = nil
45
local TempNick = nil
46
47
local NickCount = 1
48
local TotalNicks = 1
49
local NickReady = false
50
51-
local SavedNick = 100
51+
local SavedNick = nil
52
local SelPlayer = nil
53
54
local ClosestE = 10000000
55
56
function Draw() //Tracer Hook - Used to draw tracers to players
57
	for k, v in pairs (player.GetAll()) do
58
		if (v != LocalPlayer()) and (v:Alive()) then
59
			local TPlayer = v:GetPos()
60
			local TEnemy = LocalPlayer():GetPos()
61
			local TX = 0
62
			local TY = 0
63
			local TZ = 0
64
			local TT = 0
65
			TX = TEnemy.x - TPlayer.x
66
			TY = TEnemy.y - TPlayer.y
67
			TZ = TEnemy.z - TPlayer.z
68
			TT = TX + TY + TZ
69
			TT = math.abs(TT)
70
			TT = math.Round(TT)
71
			TT = "Distance: " .. TT
72
73
            local EntPos = v:EyePos():ToScreen()
74
            local EntPosWorld = v:EyePos()
75
            local PlyPos = {x = ScrW()/2,
76
                            y = ScrH()/2}
77
            local pos = LocalPlayer():GetShootPos()
78
79
			if v:Team() != LocalPlayer():Team() then
80
                surface.SetDrawColor(255, 0, 0)
81
                surface.SetTextColor(255, 0, 0)
82
            else
83
				surface.SetDrawColor(0, 255, 0)
84
                surface.SetTextColor(0, 255, 0)
85
            end
86
87
			if v:IsBot() then
88
                surface.SetDrawColor(255, 255, 0)
89
                surface.SetTextColor(255, 255, 0)
90
			end
91
92
            if v:IsAdmin() then
93
                surface.SetDrawColor(255, 0, 255)
94
                surface.SetTextColor(255, 0, 255)
95
            end
96
97
            if v:IsSuperAdmin() then
98
                surface.SetDrawColor(255, 0, 255)
99
                surface.SetTextColor(255, 0, 255)
100
            end
101
102
            if EntPos.y > 0 and EntPos.y < ScrH() then
103
                if DoDraw then
104
                    surface.DrawLine(PlyPos.x, PlyPos.y, EntPos.x, EntPos.y)
105
                end
106
				if DoRect then
107
                    surface.DrawOutlinedRect(EntPos.x, EntPos.y, 7, 7)
108
                end
109
                if DoText then
110
                    surface.SetTextPos(EntPos.x-string.len(v:Nick())*3, EntPos.y+5)
111
                    surface.DrawText(v:Nick())
112
					surface.SetTextPos(EntPos.x-string.len(TT)*3, EntPos.y+20)
113
					surface.DrawText(TT)
114
                end
115
			end
116
		end
117
	end
118
end
119
120
function Aim() //Autoaim Hook - Used to automatically aim at the head of the Player.
121
	if DoAim then
122
		for k, v in pairs (player.GetAll()) do
123
			if !(v == LocalPlayer()) then
124
				local HeadPos = v:EyePos()
125
				local THead = v:LookupBone("ValveBiped.Bip01_Head1")
126
				local HeadPos = v:GetBonePosition(THead)
127
				local PlyPos = {x = ScrW()/2,
128
								y = ScrH()/2}
129
				local pos = LocalPlayer():GetShootPos()
130
				if SelectedNick != nil then
131
					if v:Alive() and v:Nick() == SelectedNick then
132
						LocalPlayer():SetEyeAngles((HeadPos - pos):Angle())
133
						local Target = true
134
					else
135
						local Target = false
136
					end
137
				end
138
			end
139
		end
140
	end
141
end
142
143
function GetDRPStats() //Used to find DarkRP items
144
	if DoDarkRP and LocalPlayer():Alive() then
145
		for k, v in pairs(ents.GetAll()) do
146
			local EntitPos = v:GetPos():ToScreen()
147
			local ECoords = v:GetPos()
148
			local PCoords = LocalPlayer():GetPos()
149
			local DistX = 0
150
			local DistY = 0
151
			local DistZ = 0
152
			local DistT = 0
153
			DistX = ECoords.x - PCoords.x
154
			DistY = ECoords.y - PCoords.y
155
			DistZ = ECoords.z - PCoords.z
156
			DistT = DistX + DistY + DistZ
157
			DistT = math.abs(DistT)
158
			DistT = math.Round(DistT)
159
			//Debug Method
160
			if v:GetModel() != nil and DebugOn:GetBool() then
161
				surface.SetTextColor(255,255,255)
162
				surface.SetTextPos(EntitPos.x-100, EntitPos.y-30)
163
				surface.DrawText(v:GetModel())
164
			end
165
			//Money Printers
166
			if (v:GetModel() == "models/props_c17/consolebox01a.mdl") or (v:GetModel() == "models/props_c17/consolebox03a.mdl") then
167
				surface.SetDrawColor(0, 0, 255)
168
				surface.SetTextColor(0, 0, 255)
169
				surface.SetTextPos(EntitPos.x-15, EntitPos.y-30)
170
				surface.DrawText("$$$ - " .. DistT)
171
				surface.DrawOutlinedRect(EntitPos.x, EntitPos.y-10, 7, 7)
172
			end
173
			//Cash
174
			if (v:GetModel() == "models/props/cs_assault/money.mdl") then
175
				surface.SetDrawColor(0, 0, 255)
176
				surface.SetTextColor(0, 0, 255)
177
				surface.SetTextPos(EntitPos.x-15, EntitPos.y-30)
178
				surface.DrawText("$$$ - " .. DistT)
179
				surface.DrawOutlinedRect(EntitPos.x, EntitPos.y-10, 7, 7)
180
			end
181
			//Weapons Spawner
182
			if (v:GetModel() == "models/props_c17/trappropeller_engine.mdl") then
183
				surface.SetDrawColor(0, 0, 255)
184
				surface.SetTextColor(0, 0, 255)
185
				surface.SetTextPos(EntitPos.x-15, EntitPos.y-30)
186
				surface.DrawText("SPAWNER")
187
				surface.DrawOutlinedRect(EntitPos.x, EntitPos.y-10, 7, 7)
188
			end
189
			//Weps
190
			if (v:GetModel() == "models/weapons/w_pist_deagle.mdl") or
191
				(v:GetModel() == "models/weapons/w_pist_fiveseven.mdl") or
192
				(v:GetModel() == "models/weapons/w_pist_glock18.mdl") or
193
				(v:GetModel() == "models/weapons/w_pist_p228.mdl") or
194
				(v:GetModel() == "models/weapons/w_pist_usp.mdl") or
195
				(v:GetModel() == "models/weapons/w_pist_elite_dropped.mdl") then
196
				surface.SetDrawColor(0, 0, 255)
197
				surface.SetTextColor(0, 0, 255)
198
				surface.SetTextPos(EntitPos.x-5, EntitPos.y-30)
199
				surface.DrawText("GUN")
200
				surface.DrawOutlinedRect(EntitPos.x, EntitPos.y-10, 7, 7)
201
			end
202
			if v:IsWeapon() then
203
				surface.SetDrawColor(0, 0, 255)
204
				surface.SetTextColor(0, 0, 255)
205
				surface.SetTextPos(EntitPos.x-5, EntitPos.y-30)
206
				surface.DrawText("GUN")
207
				surface.DrawOutlinedRect(EntitPos.x, EntitPos.y-10, 7, 7)
208
			end
209
		end
210
	end
211
end
212
213
function GetNicks() //Used to keep a DB of nicks
214
215
if !Target then
216
	ClosestE = 10000000
217
	for k, v in pairs (player.GetAll()) do
218
	if v:IsValid() then
219
		//Math Stuff
220
			local EnemCo = v:GetPos():ToScreen()
221
			local MyCo = {x = ScrW()/2,
222
						  y = ScrH()/2}
223
			local DT = 0
224
			DT = math.sqrt((MyCo.x - EnemCo.x)^2 + (MyCo.y - EnemCo.y)^2)
225
			DT = math.Round(DT)
226
			if v:Alive() and v != LocalPlayer() and SavedNick!=nil then
227
				if DT < ClosestE then
228
					if !SavedNick:Alive() then
229
						TempNick = v:Nick()
230
					end
231
					ClosestE = DT
232
				end
233
			else
234
				if DT < ClosestE and v:Alive() and v != LocalPlayer() then
235
					TempNick = v:Nick()
236
					ClosestE = DT
237-
					SavedNick = v
237+
					SavedNick = v.GetByID
238
				end
239
			end
240
	end
241
	end
242
	NickReady = false
243
	SelectedNick = TempNick
244
	NickReady = true
245
end
246
end
247
248
function KeyListener() //Key Listener Hook
249
	if input.IsKeyDown(KEY_F6) then
250
		KeyNow = tonumber(os.clock())
251
		if KeyNow > KeyTimer then
252
			DoDraw = !DoDraw
253
			KeyTimer = tonumber(os.clock()) + 0.6
254
		end
255
	end
256
    if input.IsKeyDown(KEY_F8) then
257
		KeyNow = tonumber(os.clock())
258
		if KeyNow > KeyTimer then
259
			DoDarkRP = !DoDarkRP
260
			if DoDarkRP then
261
				hook.Add("HUDPaint", "GetDarkRP", GetDRPStats)
262
			end
263
			KeyTimer = tonumber(os.clock()) + 0.6
264
		end
265
    end
266
    if input.IsKeyDown(KEY_F9) then
267
		KeyNow = tonumber(os.clock())
268
		if KeyNow > KeyTimer then
269
			KeyTimer = tonumber(os.clock()) + 0.6
270
		end
271
    end
272
    if input.IsKeyDown(KEY_F10) then
273
        KeyNow = tonumber(os.clock())
274
        if KeyNow > KeyTimer then
275
            DoRect = !DoRect
276
            KeyTimer = tonumber(os.clock()) + 0.6
277
        end
278
    end
279
    if input.IsKeyDown(KEY_F11) then
280
		KeyNow = tonumber(os.clock())
281
		if KeyNow > KeyTimer then
282
			DoText = !DoText
283
            KeyTimer = tonumber(os.clock()) + 0.6
284
        end
285
    end
286
	if input.IsMouseDown(MOUSE_MIDDLE) then
287
		KeyNow = tonumber(os.clock())
288
		if KeyNow > KeyTimer then
289
			DoAim = !DoAim
290
			KeyTimer = tonumber(os.clock()) + 0.6
291
		end
292
	end
293
end
294
295
function HUD() //HUD Paint Hook
296
        if ShowHUD then
297
			if SelectedNick != nil then
298
				draw.WordBox( 8, (ScrW()/2)-80, 8, "Aimbot Target: " .. SelectedNick, "Default", Color(50, 50, 75, 100), Color(0, 255, 0, 255) )
299
			else
300
				draw.WordBox( 8, (ScrW()/2)-80, 8, "Aimbot Target: [Off]", "Default", Color(50, 50, 75, 100), Color(0, 255, 0, 255) )
301
			end
302
			//Tracers
303
			if DoDraw then
304
				draw.WordBox( 8, 415, ScrH()-27, "[F6] Tracers [On]", "Default", Color(50, 50, 75, 100), Color(50, 205, 50, 255) )
305
			else
306
                draw.WordBox( 8, 415, ScrH()-27, "[F6] Tracers [Off]", "Default", Color(50, 50, 75, 100), Color(190, 190, 190, 255) )
307
            end
308
			//Aimbot
309
			if !DoAim then
310
                draw.WordBox( 8, 300, ScrH()-27, "[F7] Aimbot [OFF]", "Default", Color(50, 50, 75, 100), Color(190, 190, 190, 255) )
311
            else
312
                draw.WordBox( 8, 300, ScrH()-27, "[F7] Aimbot [ON]  ", "Default", Color(50, 50, 75, 100), Color(50, 205, 50, 255) )
313
            end
314
			//Player Marker
315
			if !DoRect then
316
				draw.WordBox( 8, 530, ScrH()-27, "[F10] Player Markers [OFF]", "Default", Color(50, 50, 75, 100), Color(190, 190, 190, 255) )
317
			else
318
				draw.WordBox( 8, 530, ScrH()-27, "[F10] Player Markers [ON]  ", "Default", Color(50, 50, 75, 100), Color(50, 205, 50, 255) )
319
			end
320
			//Text
321
			if !DoText then
322
				draw.WordBox( 8, 691, ScrH()-27, "[F11] Player Names [OFF]", "Default", Color(50, 50, 75, 100), Color(190, 190, 190, 255) )
323
			else
324
				draw.WordBox( 8, 691, ScrH()-27, "[F10] Player Names [ON]  ", "Default", Color(50, 50, 75, 100), Color(50, 205, 50, 255) )
325
			end
326
			//DarkRP
327
			if !DoDarkRP then
328
				draw.WordBox( 8, 845, ScrH()-27, "[F8] DarkRP [OFF]", "Default", Color(50, 50, 75, 100), Color(190, 190, 190, 255) )
329
			else
330
				draw.WordBox( 8, 845, ScrH()-27, "[F8] DarkRP [On]", "Default", Color(50, 50, 75, 100), Color(50, 205, 50, 255) )
331
			end
332
        end
333
end