Forum

> > CS2D > Scripts > antihack script. what's wrong with his function?
Forums overviewCS2D overview Scripts overviewLog in to reply

English antihack script. what's wrong with his function?

1 reply
To the start Previous 1 Next To the start

old antihack script. what's wrong with his function?

MikuAuahDark
User Off Offline

Quote
i want to create a antihack with ms100 hook, but it doesn't work(no error on console) i tired everything but it keep not wor. so what's wrong with my script below?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
-- Antihack by Rian2_idih

posbetween = 250
pinglag = 500

pos = {}
for id = 1,32 do
	pos[id]={0,0}
end

function detection(x1,x2)
	value = 0
	if (x1-x2)<0 then
		temp1 = (x1-x2)*2
		temp2 = (x1-x2)-temp1
		value = temp2
	elseif (x1-x2)>=0 then
		value = (x1-x2)
	end
	return value
end
	
addhook("ms100","nottoolaggy")
function nottoolaggy()
	for _, id in pairs(player(0,"tableliving")) do
		speedhack = false
		if detection(player(id,"x"),pos[id][1])>=posbetween then
			speedhack = true
		end
		if detection(player(id,"y"),pos[id][2])>=posbetween then
			speedhack = true
		end
		if speedhack==true then
			if player(id,"ping")<pinglag then
				msg(string.char(169).."255000000"..player(id,"name").." use speedhack!")
			end
		end
		pos[id][1] = player(id,"x")
		pos[id][2] = player(id,"y")
		parse("hudtxt2 "..id.." 1 \""..detection(pos[id][1],player(id,"x")).."x"..detection(pos[id][2],player(id,"y")).."\" 0 0")	-- just for debugging but it always returns "0x0"
	end
end
please someone can fix, i will credits you if you fix it

old Re: antihack script. what's wrong with his function?

Snurq
BANNED Off Offline

Quote
Problem with this attempt is that a player might get a lag spike. Your script would lead to a false positive. It would be better to look at the average speed of a player over a large number of frames.

Also note that ms100 isn't always 100 milliseconds. It could also be 100.2 milliseconds or 99.8..
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview